Path: utzoo!censor!geac!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!elroy.jpl.nasa.gov!thyme!kaleb From: kaleb@thyme.jpl.nasa.gov (Kaleb Keithley ) Newsgroups: comp.windows.x.motif Subject: Re: When to free XmStrings? Message-ID: <1990Dec6.170054.10627@thyme.jpl.nasa.gov> Date: 6 Dec 90 17:00:54 GMT References: <361@uucs1.UUCP> Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 34 In article <361@uucs1.UUCP> gaf@uucs1.UUCP () writes: > >One of the things about Motif which has never been clear to me is under what >conditions I'm expected to free memory which a library function has allocated. > >Should I free the result of an XmStringCreateLtoR() or an XmStringGetLtoR()? In general, yes. The release notes identify the exceptions to this rule, if you could call it a rule. >Does it matter whether I use free() or XmStringFree()? In 1.1, XmStringFree() just calls XtFree(). XtFree() checks for null ptr and calls XFree(), XFree() calls free(). >When I call XtSetValues() to set or change some XmString resource, can I >free the XmString immediately afterward (i.e. do the library functions always >make a copy of what I pass) or hang onto it forever? We do. >And, finally, why does nobody offer Motif classes at reasonable prices :-). >(A few thousand a head plus T&L is too much for little companies like us) We paid $1000/person (at least that's what was charged to our project) to have OSF teach Motif programming. Price included the Prentice Hall OSF/Motif documentation set. The course was well done, the instructor first rate. -- Kaleb Keithley Jet Propulsion Labs kaleb@thyme.jpl.nasa.gov You can please all of the people some of the time,