summaryrefslogtreecommitdiffstats
path: root/generic/tkWindow.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkWindow.c')
-rw-r--r--generic/tkWindow.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index c652e34..390325e 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWindow.c,v 1.68 2005/08/16 16:36:15 dkf Exp $
+ * RCS: @(#) $Id: tkWindow.c,v 1.69 2005/09/21 10:54:40 dkf Exp $
*/
#include "tkPort.h"
@@ -2677,6 +2677,10 @@ DeleteWindowsExitProc(clientData)
Tcl_Interp *interp;
ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData;
+ if (tsdPtr == NULL) {
+ return;
+ }
+
/*
* Finish destroying any windows that are in a half-dead state. We must
* protect the interpreter while destroying the window, because of
@@ -3133,17 +3137,18 @@ Initialize(interp)
*/
code = TkpInit(interp);
- if(code != TCL_OK) {
+ if (code != TCL_OK) {
goto done;
}
/*
- * Create exit handler to delete all windows when the application exits.
- * This handler needs to be invoked before other platform specific
- * cleanups take place to avoid panics in finalization.
+ * Create exit handlers to delete all windows when the application or
+ * thread exits. These handler need to be invoked before other platform
+ * specific cleanups take place to avoid panics in finalization.
*/
- TkCreateExitHandler(DeleteWindowsExitProc, (ClientData) tsdPtr);
+ TkCreateExitHandler(DeleteWindowsExitProc, (ClientData) NULL);
+ TkCreateThreadExitHandler(DeleteWindowsExitProc, (ClientData) tsdPtr);
done:
if (argv != NULL) {