diff options
author | hobbs <hobbs> | 2002-12-06 23:22:58 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2002-12-06 23:22:58 (GMT) |
commit | 25434df7c01e5696ea3b4affeed85ad22d09587b (patch) | |
tree | 5e8124bd90814fbe5a1f2116ec1fb5a93273caed /win/tclWinInit.c | |
parent | 5bde345b62e89154c0dfe9f36adad96e97e69323 (diff) | |
download | tcl-25434df7c01e5696ea3b4affeed85ad22d09587b.zip tcl-25434df7c01e5696ea3b4affeed85ad22d09587b.tar.gz tcl-25434df7c01e5696ea3b4affeed85ad22d09587b.tar.bz2 |
* generic/tclStubInit.c: regen
* generic/tclIntPlatDecls.h: regen
* generic/tclInt.decls: added TclWinResetInterface
* win/tclWin32Dll.c (TclWinResetInterfaces):
* win/tclWinInit.c (TclpSetInitialEncodings, WinEncodingsCleanup):
add exit handler that resets the encoding information to a state
where we can reuse Tcl. Following these changes, it is possible
to reuse Tcl (following Tcl_FindExecutable or Tcl_CreateInterp)
following a Tcl_Finalize.
Diffstat (limited to 'win/tclWinInit.c')
-rw-r--r-- | win/tclWinInit.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/win/tclWinInit.c b/win/tclWinInit.c index c4782e3..bc0c980 100644 --- a/win/tclWinInit.c +++ b/win/tclWinInit.c @@ -7,7 +7,7 @@ * Copyright (c) 1998-1999 by Scriptics Corporation. * All rights reserved. * - * RCS: @(#) $Id: tclWinInit.c,v 1.35 2002/02/08 02:52:55 dgp Exp $ + * RCS: @(#) $Id: tclWinInit.c,v 1.36 2002/12/06 23:22:59 hobbs Exp $ */ #include "tclWinInt.h" @@ -461,7 +461,34 @@ ToUtf( *dst = '\0'; return (int) (dst - start); } + +/* + *--------------------------------------------------------------------------- + * + * WinEncodingsCleanup -- + * + * Reset information to its original state in finalization to + * allow for reinitialization to be possible. + * + * Results: + * None. + * + * Side effects: + * Static information reset to startup state. + * + *--------------------------------------------------------------------------- + */ +static void +WinEncodingsCleanup(ClientData clientData) +{ + TclWinResetInterfaces(); + libraryPathEncodingFixed = 0; + if (binaryEncoding != NULL) { + Tcl_FreeEncoding(binaryEncoding); + binaryEncoding = NULL; + } +} /* *--------------------------------------------------------------------------- @@ -538,6 +565,8 @@ TclpSetInitialEncodings() encoding = "iso8859-1"; binaryEncoding = Tcl_GetEncoding(NULL, encoding); } + + Tcl_CreateExitHandler(WinEncodingsCleanup, NULL); } /* |