Path: utzoo!attcan!uunet!know!sdd.hp.com!hplabs!hpfcso!hpfcdq!brown From: brown@hpfcdq.HP.COM (John Brown) Newsgroups: comp.windows.x Subject: When to XmStringFree()? Message-ID: <890048@hpfcdq.HP.COM> Date: 23 Oct 90 02:01:40 GMT Organization: Hewlett-Packard - Fort Collins, CO Lines: 25 Here's a Motif 1.0 question . . . I'm a bit confused about when it is appropriate to perform an XmStringFree() on compound strings which have been used to specify widget resources via XtSetArg() and XtSetValues() calls. I'm having particular trouble knowing what to do with arrays of XmStrings used to create or change the contents of an XmList widget. I'm currently doing all the XmStringFree() calls I think are appropriate, but my application data size still grows whenever I do the following: (Create array of XmStrings) i = 0; XtSetArg(wargs[i], XmNitems, string_list); i++; XtSetArg(wargs[i], XmNitemCount, num_strings); i++; XtSetArg(wargs[i], XmNselectedItemCount, 0); i++; XtSetValues(w, wargs, i); (XmStringFree each XmString in the array) Do I need to somehow free the current XmNitems array in the list widget before specifying a new one? Or is that done automatically? Please help! Thanks in advance! John Brown HP Graphics Technology Division