diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclStubLib.c | 26 |
2 files changed, 21 insertions, 11 deletions
@@ -1,3 +1,9 @@ +2002-12-03 Jeff Hobbs <jeffh@ActiveState.com> + + * generic/tclStubLib.c (Tcl_InitStubs): prevent the cached check of + tclStubsPtr to allow for repeated load/unload of the Tcl dll by + hosting apps. [Bug 615304] + 2002-12-03 David Gravereaux <davygrvy@pobox.com> * win/tclAppInit.c (sigHandler): Protect from trying to close a diff --git a/generic/tclStubLib.c b/generic/tclStubLib.c index f1f165e..c650dac 100644 --- a/generic/tclStubLib.c +++ b/generic/tclStubLib.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclStubLib.c,v 1.5 2001/04/04 16:07:21 kennykb Exp $ + * RCS: @(#) $Id: tclStubLib.c,v 1.6 2002/12/04 07:07:59 hobbs Exp $ */ /* @@ -36,10 +36,10 @@ #undef TCL_STORAGE_CLASS #define TCL_STORAGE_CLASS DLLEXPORT -TclStubs *tclStubsPtr; -TclPlatStubs *tclPlatStubsPtr; -TclIntStubs *tclIntStubsPtr; -TclIntPlatStubs *tclIntPlatStubsPtr; +TclStubs *tclStubsPtr = NULL; +TclPlatStubs *tclPlatStubsPtr = NULL; +TclIntStubs *tclIntStubsPtr = NULL; +TclIntPlatStubs *tclIntPlatStubsPtr = NULL; static TclStubs * HasStubSupport _ANSI_ARGS_((Tcl_Interp *interp)); @@ -86,14 +86,18 @@ Tcl_InitStubs (interp, version, exact) CONST char *version; int exact; { - CONST char *actualVersion; + CONST char *actualVersion = NULL; TclStubs *tmp; - + + /* + * We can't optimize this check by caching tclStubsPtr because + * that prevents apps from being able to load/unload Tcl dynamically + * multiple times. [Bug 615304] + */ + + tclStubsPtr = HasStubSupport(interp); if (!tclStubsPtr) { - tclStubsPtr = HasStubSupport(interp); - if (!tclStubsPtr) { - return NULL; - } + return NULL; } actualVersion = Tcl_PkgRequireEx(interp, "Tcl", version, exact, |