How to cleanup an object with a non-modal widget method [message #88066] |
Mon, 17 March 2014 14:24  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
I have an object with a non-modal widget display method. While it is usually used in communication with other objects, I also want to have a simple wrapper to display the widget.
pro displaymap
oAstroMap = obj_new('AstroMap') ;Create the object
oAstroMap.widgetdisplay ;Create the display widget
return
end
While this works, it doesn't clean up after itself, leaving the heap area full. I can't put an OBJ_DESTROY statement before the RETURN because the non-modal widget doesn't wait for the widget to be destroyed, and executes the OBJ_DESTROY right away.
I suppose what I want is for the widget to destroy the underlying object when one presses the Quit button. But my experiments with "OBJ_DESTROY, self " have not been successful. Thanks, --Wayne
|
|
|