[comp.windows.x] Help alleviate exit confusion

Steve.Handerson@NL.CS.CMU.EDU (08/09/90)

Hello.

This post will be pretty vague, since I'm just starting
with toolkit programming and tend to be confused anyway.
Please respond if you know what I'm talking about;
pointers to existing sources of answers would be fine.
I'll accept hacks, but I'd prefer to know the "right way".

I'm working from lisp, (but doing most widget-side programming in C)
and so do not have the luxury of assuming that everything
(process, windows, local storage, and widget storage)
disappears when one exits the application.
In fact, I'd like to be able to exit the application function and re-start.
I have my own event-handling loop on the C side, so I 
can exit this and return control to lisp.
The basic question is "when can I do this safely?"

Apparently I have to keep the event-handling loop 
operating until everything is cleaned up, and then exit it.
Apparently the widgets intermix storage deallocation/cleanup with 
window unmapping/destroying, so if I close the display or
destroy the application context prematurely,
I get horrible errors the next time I initialize/open.

Waiting for the shell to be unrealized doesn't work,
since apparently it becomes "unrealized" 
before its children's windows have disappeared from the display.
Timeouts are too arbitrary.

I'm working on a Decstation 3100, Ultrix V2.2 rev 15,
X11 version (3, I guess) vendor-release 1, XUI toolkit.

Thanks in advance,

-- Steve