Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!portal!cup.portal.com!DeadHead From: DeadHead@cup.portal.com (Bruce M Ong) Newsgroups: comp.windows.x.motif Subject: Re: Memory Leak in Motif 1.0 Dialog Widgets (Interactive port) Message-ID: <34665@cup.portal.com> Date: 9 Oct 90 01:52:29 GMT References: <34367@cup.portal.com> <9010021752.AA16081@osf.osf.org> Distribution: na Organization: The Portal System (TM) Lines: 42 >Bruce Ong posted a program that has a memory leak. It involved continually >re-Setting the items and itemCount of a Selectionbox. > .... > >Second, the best thing you can do about this particular case is use the >XmListDeletePos and XmListAddItem calls, instead of updating the resources >directly (use XmSelectionBoxGetChild to find the list). > >David Brooks >Systems Engineering >Open Software Foundation Unfortunately that work-around does not work. It hangs. here is a core trace after doing a ^\ QueryProc(0x458c5c,0x7ffff6c4,0x7ffff6a4) [List.c] XtQueryGeometry(0x458c5c,0x7ffff6c4,0x7ffff6a4) [Geometry.c] VariableLayout(0x456538) [ScrolledW.c] Resize(0x456538) [ScrolledW.c] GeometryManager(0x458c5c,0x7ffff85c,0x7ffff83c) [ScrolledW.c] XtMakeGeometryRequest(0x458c5c,0x7ffff85c,0x7ffff83c) [Geometry.c] XtSetValues(0x458c5c,0x402544,2) [Resources.c] SetNewSize(0x458c5c) [List.c] XmListDeletePos(0x458c5c,1) [List.c] cb(0,0) it seems to hang on the 3rd iteration. I assumed that it was hanging in one of those resize management routines, and set XmNnoResize to true... but it would not help any. I dont know if it is because the selectionbox is managed under a dialog shell or not. I will continue to experiement - but I want to post this trace just in case there is a bug in the QueryProc routine which has not been previously discovered. One thing that is weird is that I call XmListDeletePos(widget,position) with a position value of "0" (delete the last item on list) , but in the core trace it has a value of 1 ! /bruce deadhead@cup.portal.com