summaryrefslogtreecommitdiffstats
path: root/win/tclWin32Dll.c
diff options
context:
space:
mode:
authordavygrvy <davygrvy@pobox.com>2004-04-20 02:10:38 (GMT)
committerdavygrvy <davygrvy@pobox.com>2004-04-20 02:10:38 (GMT)
commit21b974e4ba53062d6e65d7ee912fb97aa14ab330 (patch)
tree10aa82ba334081a3425ea1a61427096c44041daf /win/tclWin32Dll.c
parent354d7f73aad4cceb29dd5f6596df5471d658b54b (diff)
downloadtcl-21b974e4ba53062d6e65d7ee912fb97aa14ab330.zip
tcl-21b974e4ba53062d6e65d7ee912fb97aa14ab330.tar.gz
tcl-21b974e4ba53062d6e65d7ee912fb97aa14ab330.tar.bz2
Added an exit handler in tclWinInit() so tclWinTCharEncoding could be freed
for Tcl_Finalize.
Diffstat (limited to 'win/tclWin32Dll.c')
-rw-r--r--win/tclWin32Dll.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/win/tclWin32Dll.c b/win/tclWin32Dll.c
index 4a5aefd..4059373 100644
--- a/win/tclWin32Dll.c
+++ b/win/tclWin32Dll.c
@@ -9,7 +9,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclWin32Dll.c,v 1.32 2004/01/21 19:59:34 vincentdarley Exp $
+ * RCS: @(#) $Id: tclWin32Dll.c,v 1.33 2004/04/20 02:10:38 davygrvy Exp $
*/
#include "tclWinInt.h"
@@ -156,6 +156,7 @@ static TclWinProcs unicodeProcs = {
TclWinProcs *tclWinProcs;
static Tcl_Encoding tclWinTCharEncoding;
+Tcl_ExitProc TclWinUninit;
/*
* The following declaration is for the VC++ DLL entry point.
@@ -397,6 +398,34 @@ TclWinInit(hInst)
}
tclWinProcs = &asciiProcs;
+ Tcl_CreateExitHandler(TclWinUninit, NULL);
+}
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclWinUninit --
+ *
+ * Exit handler callback to remove private components used in this
+ * file.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * Tcl_WinTCharToUtf and Tcl_WinUtfToTChar will not work during
+ * the latter half of Tcl_Finalize.
+ *
+ *----------------------------------------------------------------------
+ */
+
+void
+TclWinUninit (ClientData clientData)
+{
+ if (tclWinTCharEncoding) {
+ Tcl_FreeEncoding(tclWinTCharEncoding);
+ tclWinTCharEncoding = NULL;
+ }
}
/*