Path: utzoo!attcan!uunet!cs.utexas.edu!wuarchive!udel!eplrx7!rogerska From: rogerska@eplrx7.uucp (Allen Rogers) Newsgroups: comp.windows.x Subject: Multiple Initialization of a Composite Widget Message-ID: <1990Sep26.203551.13252@eplrx7.uucp> Date: 26 Sep 90 20:35:51 GMT Sender: usenet@ee.udel.edu Organization: DuPont Engineering Physics Lab Lines: 43 Nntp-Posting-Host: louie.udel.edu I have a program that creates a composite widget with XtAppInitialize. When the user presses the quit button, I use XtDestroyApplicationContext to destroy the composite widget but the program does not exit. Instead the program recreates the same composite widget with XtAppInitialize: forever { toplevel=XtAppInitialize(); ... do { XtMainLoop(); ... } while (not quit); XtDestroyApplicationContext(); } The first time I create and destroy the widget everything works correctly. The second time I create the widget I get the following warnings: Warning: Initializing Resource Lists twice Warning: Intializing Translation manager twice When I destroy it again I get a bad free: free: block 0x788d58 was already free and the program crashes. I have tried replacing the XtDestroyApplicationContext with an XtCloseDisplay without success. It appears that since I am not exiting the main program some Xt resources aren't getting cleared. Does anyone have any insight or suggestions??? Thanks in advance, Allen Rogers rogerska%esvax@dupont.com -- The UUCP Mailer