summaryrefslogtreecommitdiffstats
path: root/generic/tclEvent.c
diff options
context:
space:
mode:
authordavidg <davidg@noemail.net>2000-11-02 23:34:33 (GMT)
committerdavidg <davidg@noemail.net>2000-11-02 23:34:33 (GMT)
commitd1bc046c33fc8a3f8336614b4fff20161135c5e6 (patch)
treefad5ddefb37c8c815d3224dd1a8e2ce6471c0c5e /generic/tclEvent.c
parent651d9a8106c60a6f6a5a3cca6cb78523e14264ca (diff)
downloadtcl-d1bc046c33fc8a3f8336614b4fff20161135c5e6.zip
tcl-d1bc046c33fc8a3f8336614b4fff20161135c5e6.tar.gz
tcl-d1bc046c33fc8a3f8336614b4fff20161135c5e6.tar.bz2
Added some more comments and a missing Tcl_IncrRefCount in
TclGetLibraryPath() when the tclLibraryPath Tcl_Obj needs to be created. FossilOrigin-Name: dfbe5d11b6e2e0af1cadaddf0a03ac96d727d90d
Diffstat (limited to 'generic/tclEvent.c')
-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;
}