diff options
author | hobbs <hobbs@noemail.net> | 2002-12-04 07:07:58 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2002-12-04 07:07:58 (GMT) |
commit | fbbc72899e3f18c85e2f92c58662b90c3c8cfa32 (patch) | |
tree | 987b113cb5fc7cc2021bbf9ee1544429ed6eca74 /generic/tclStubLib.c | |
parent | 3036769093bf961352f1d8a3a6f3b07fe5178bcc (diff) | |
download | tcl-fbbc72899e3f18c85e2f92c58662b90c3c8cfa32.zip tcl-fbbc72899e3f18c85e2f92c58662b90c3c8cfa32.tar.gz tcl-fbbc72899e3f18c85e2f92c58662b90c3c8cfa32.tar.bz2 |
* 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]
FossilOrigin-Name: c8487bfd30326a2f36756bda3cf6e70388a80fe0
Diffstat (limited to 'generic/tclStubLib.c')
-rw-r--r-- | generic/tclStubLib.c | 26 |
1 files changed, 15 insertions, 11 deletions
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, |