[comp.windows.x] Problems destroying topLevelShellWidgets

jkh@pcsbst.UUCP (jkh) (04/04/89)

I have a widget based application that likes to pop up ancillary display
windows from time to time, each of which can be closed independently.

I create a single top level shell with XtInitialize(). Fine. Then I create
one of these other display windows as type "topLevelShellWidget", using
XtCreatePopupShell() with my original top level shell as a parent, and
pop it up with XtPopup(). Still no problem. Inside this popup shell
is a form widget and inside the form are a number of buttons. One of
the button's job is to "close" the entire display window. Ok, says I, I'll
just XtPopdown() the top level popup shell. Wonderful. Works great.
But for various reasons, I can't re-use one of these popup shells once
they've been closed, so it doesn't make much sense for me to leave it
around, wasting resources. When I try to do an XtDestroyWidget() on
the popup shell, the application coredumps. Based on the following
stacktrace, can anyone give me some idea of what's going on?

#0  0x3f362 in lmalloc (16)
#1  0x3f532 in malloc (16)
#2  0x15656 in XtMalloc (16)
#3  0x15816 in _XtAddCallback (1274020, 1065348112, 99810, 0)
#4  0x1877a in XtDestroyWidget (1274020)
#5  0x119e2 in TextDestroy (1273644)
#6  0x185d0 in Phase2Destroy (1273644)
#7  0x18536 in Recursive (1273644, 99710)
#8  0x1849a in Recursive (1272924, 99710)
#9  0x1849a in Recursive (1272632, 99710)
#10 0x18700 in XtPhase2Destroy (1272632, 0, 0)
#11 0x15c16 in _XtCallCallbacks (1065348116, 0)
#12 0x1a2b6 in XtDispatchEvent (1065348164)
#13 0x1a66a in XtAppMainLoop (1163784)
#14 0x1a648 in XtMainLoop ()
#15 0x2e0 in main (1, 1065348434, 1065348442) (main.c line 149)


It *is* possible to destroy one of these things, isn't it?

					Jordan
-- 
--------
				Jordan Hubbard
				PCS Computer Systeme GmbH
				West Germany
	UUCP:			{uunet,decwrl}!pyramid!pcsbst!jkh
	ARPA:			jkh@violet.berkeley.edu

	"I'd like a burrito please."
	"Was?"
	"Uh. Ich moechte ein Mexicanische 'Burrito', bitte."
	"Hahahahahahaha.. Das ist ein guter Witz. Du bist toll.."
	"Hey! It's real easy, just take some cheese, some meat and
	some beans and roll it up like this.."
	"Raus!"

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (04/19/89)

> I create a single top level shell with XtInitialize(). Fine. Then I create
> one of these other display windows as type "topLevelShellWidget", using
> XtCreatePopupShell() with my original top level shell as a parent, and
> pop it up with XtPopup().
> It *is* possible to destroy one of these things, isn't it?

Yep, it appears that you have run into a known bug in destroying widgets.
This is the same thing that has caused xman to die when you use "remove
this manual page".  This will be fixed in the next release.


					Chris D. Peterson
					MIT X Consortium