summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordavidg <davidg>2000-11-02 23:34:34 (GMT)
committerdavidg <davidg>2000-11-02 23:34:34 (GMT)
commitc2e90ea6af2571fcf719c01d5d42ea8c8d1b5960 (patch)
treefad5ddefb37c8c815d3224dd1a8e2ce6471c0c5e /generic
parenta94d1c28b444987b6dda657ec96c91f364781438 (diff)
downloadtcl-c2e90ea6af2571fcf719c01d5d42ea8c8d1b5960.zip
tcl-c2e90ea6af2571fcf719c01d5d42ea8c8d1b5960.tar.gz
tcl-c2e90ea6af2571fcf719c01d5d42ea8c8d1b5960.tar.bz2
Added some more comments and a missing Tcl_IncrRefCount in
TclGetLibraryPath() when the tclLibraryPath Tcl_Obj needs to be created.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclEvent.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/generic/tclEvent.c b/generic/tclEvent.c
index b6715b3..2fff780 100644
--- a/generic/tclEvent.c
+++ b/generic/tclEvent.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclEvent.c,v 1.9 2000/11/02 22:04:54 davidg Exp $
+ * RCS: @(#) $Id: tclEvent.c,v 1.10 2000/11/02 23:34:34 davidg Exp $
*/
#include "tclInt.h"
@@ -601,6 +601,11 @@ TclSetLibraryPath(pathPtr)
Tcl_DecrRefCount(tsdPtr->tclLibraryPath);
}
tsdPtr->tclLibraryPath = pathPtr;
+
+ /*
+ * No mutex locking is needed here as up the stack we're within
+ * TclpInitLock().
+ */
tclLibraryPathStr = Tcl_GetStringFromObj(pathPtr, NULL);
}
@@ -627,7 +632,14 @@ TclGetLibraryPath()
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
if (tsdPtr->tclLibraryPath == NULL) {
+ /*
+ * Grab the shared string and place it into a new thread specific
+ * Tcl_Obj.
+ */
tsdPtr->tclLibraryPath = Tcl_NewStringObj(tclLibraryPathStr, -1);
+
+ /* take ownership */
+ Tcl_IncrRefCount(tsdPtr->tclLibraryPath);
}
return tsdPtr->tclLibraryPath;
}