Memory Leak in Motif 1.0 Dialog Widgets (Interactive port)

Timothy J. Horton tjhorton at ai.toronto.edu
Sat Sep 29 18:34:33 AEST 1990


DeadHead at cup.portal.com (Bruce M Ong) writes:
>	The motif dialog widget - the selection box dialog -  does
>not seem to clean up its internal data when a new XtSetArg() is called
>with  a different item count and a different item list than the previous call.

(Keep in mind that even if the widget cleans up, memory fragmentation will
eventually cause your process to perpetually grow, however slowly.)

I was worried enough about this problem that I wrote my own selection
code -- using a draw window and a text widget -- because I use swap
in *particularly* long lists -- 2000 at a time -- quite often.

I can simply reset the item list pointer (to an existing array of string
pointers) and the item count, and clear the window.  It saves both in terms
of memory utilization and processing.  The code is maybe 300 lines,
and carefully debugged, but it's not "widgetized" -- packaged up
as a new widget.  That would have been far too much work, to create
such a specialized wheel, because I haven't written full-fledged widgets
before.  If anybody is experienced at writing widgets and would be willing
to contribute this to the world, I'd contribute what I could.

tjhorton at ai.toronto.edu
uunet!jtsv16!geac!tse!cont1



More information about the Comp.unix.sysv386 mailing list