diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2005-09-21 10:54:40 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2005-09-21 10:54:40 (GMT) |
commit | c6e0e2261b1585c0b28b7abfb41852b5750aaf13 (patch) | |
tree | 568c1c4a6a82c9fe3153dba25af68d61019419bc /generic/tkWindow.c | |
parent | 998bc689837b9f81b076f05e0320a141c72e8540 (diff) | |
download | tk-c6e0e2261b1585c0b28b7abfb41852b5750aaf13.zip tk-c6e0e2261b1585c0b28b7abfb41852b5750aaf13.tar.gz tk-c6e0e2261b1585c0b28b7abfb41852b5750aaf13.tar.bz2 |
Tk-internal exit handler improvements. [Bug 749908]
Diffstat (limited to 'generic/tkWindow.c')
-rw-r--r-- | generic/tkWindow.c | 17 |
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) { |