summaryrefslogtreecommitdiffstats
path: root/generic/tclStubLib.c
diff options
context:
space:
mode:
authorhobbs <hobbs>2002-12-04 07:07:58 (GMT)
committerhobbs <hobbs>2002-12-04 07:07:58 (GMT)
commit3ec15d47f45aee77ef86ca5943b8c7624c37718c (patch)
tree987b113cb5fc7cc2021bbf9ee1544429ed6eca74 /generic/tclStubLib.c
parent3fd2ddaa800f0f13be22ed384ff631906d909ea4 (diff)
downloadtcl-3ec15d47f45aee77ef86ca5943b8c7624c37718c.zip
tcl-3ec15d47f45aee77ef86ca5943b8c7624c37718c.tar.gz
tcl-3ec15d47f45aee77ef86ca5943b8c7624c37718c.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]
Diffstat (limited to 'generic/tclStubLib.c')
-rw-r--r--generic/tclStubLib.c26
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,