Title: | DECWINDOWS 26-JAN-89 to 29-NOV-90 |
Notice: | See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit |
Moderator: | STAR::VATNE |
Created: | Mon Oct 30 1989 |
Last Modified: | Mon Dec 31 1990 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 3726 |
Total number of notes: | 19516 |
In one of the gobe examples there is a code segment that looks like void routine_x() { DwtCompString title = DwtLatin1String("TITLE"); . . main body . . XtFree(title); } It appears that the dwtlatin1string call is allocating space on the stack, hence the xtfree is not necessary (or worse, shouldn't be done). Is this the case? Or is the XtFree required? Thanks /Jim
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
2234.1 | QUARK::LIONEL | Free advice is worth every cent | Thu Feb 08 1990 11:08 | 10 | |
The XtFree is required. The storage for the compound string is allocated from the heap. (What made you think it came from the stack?) What's more, you need to be careful when using operations such as StrCat, because if you specify an existing compound string as the output, the routine won't deallocate the old one before stomping on the pointer. See the version of DECBURGER (in C, Ada or FORTRAN) in VMS V5.3 for examples. Steve |