summaryrefslogtreecommitdiffstats
path: root/generic/tkWindow.c
diff options
context:
space:
mode:
authordavygrvy <davygrvy>2003-12-21 23:50:13 (GMT)
committerdavygrvy <davygrvy>2003-12-21 23:50:13 (GMT)
commit4806cf66c609d6f1148a0573cd2cf44a417a2bfc (patch)
tree0dd59c8ef95660d1afe7967786a7a4fd4f6bdedd /generic/tkWindow.c
parent4e6b58608897ee2d92d0dd3d123f71c60b4a2f96 (diff)
downloadtk-4806cf66c609d6f1148a0573cd2cf44a417a2bfc.zip
tk-4806cf66c609d6f1148a0573cd2cf44a417a2bfc.tar.gz
tk-4806cf66c609d6f1148a0573cd2cf44a417a2bfc.tar.bz2
* generic/tkEvent.c: Added three new functions: TkCreateExitHandler,
* generic/tkInt.h: TkDeleteExitHandler, and TkFinalize. This adds * generic/tkMenu.c: an insertion point so Tk's exit handlers can be * generic/tkWindow.c: called on their own from tk85.dll's DllMain * mac/tkMacButton.c: for DLL_PROCESS_DETACH. These are private to * unix/tkUnixEvent.c: the binary and not exported. It is possible * win/tkWin32Dll.c: the Windows OS can unload Tk _prior_ to Tcl * win/tkWinEmbed.c: under some conditions such as ExitProcess(). * win/tkWinMenu.c: This avoids a dangling pointer problem when Tcl * win/tkWinX.c: does Tcl_Finalize after Tk has been unloaded. * win/winMain.c: DllMain's DLL_PROCESS_DETACH now protected with SEH as DeleteWindowsExitProc is causing an exception of its own under some teardown conditions. AT&T assembly syntax has not been added for MinGW yet. [Tcl Patch 858493]
Diffstat (limited to 'generic/tkWindow.c')
-rw-r--r--generic/tkWindow.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/generic/tkWindow.c b/generic/tkWindow.c
index fde6736..d14f125 100644
--- a/generic/tkWindow.c
+++ b/generic/tkWindow.c
@@ -12,7 +12,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.60 2003/07/18 13:24:19 vincentdarley Exp $
+ * RCS: @(#) $Id: tkWindow.c,v 1.61 2003/12/21 23:50:13 davygrvy Exp $
*/
#include "tkPort.h"
@@ -360,7 +360,7 @@ CreateTopLevelWindow(interp, parent, name, screenName, flags)
* exits.
*/
- Tcl_CreateExitHandler(DeleteWindowsExitProc, (ClientData) NULL);
+ TkCreateExitHandler(DeleteWindowsExitProc, (ClientData) tsdPtr);
}
if ((parent != NULL) && (screenName != NULL) && (screenName[0] == '\0')) {
@@ -2705,12 +2705,11 @@ Tk_GetNumMainWindows()
static void
DeleteWindowsExitProc(clientData)
- ClientData clientData; /* Not used. */
+ ClientData clientData; /* tsdPtr when handler was created. */
{
TkDisplay *dispPtr, *nextPtr;
Tcl_Interp *interp;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *) clientData;
/*
* Finish destroying any windows that are in a