summaryrefslogtreecommitdiffstats
path: root/generic/tclObj.c
diff options
context:
space:
mode:
authormsofer <msofer@noemail.net>2002-08-24 01:29:45 (GMT)
committermsofer <msofer@noemail.net>2002-08-24 01:29:45 (GMT)
commit55b48548ca65917d66d9a77456f1dba916b97f68 (patch)
tree6840679cb94abeac12161a8b42cf3a950a24df27 /generic/tclObj.c
parent19cf22566ac0b46fda9405abede1f7c15816b46d (diff)
downloadtcl-55b48548ca65917d66d9a77456f1dba916b97f68.zip
tcl-55b48548ca65917d66d9a77456f1dba916b97f68.tar.gz
tcl-55b48548ca65917d66d9a77456f1dba916b97f68.tar.bz2
2002-08-23 Miguel Sofer <msofer@users.sourceforge.net>
* generic/tclObj.c (USE_THREAD_ALLOC): fixed leak [Bug 597936]. Thanks to Zoran Vasiljevic. FossilOrigin-Name: f6b3630f199bc6ab6fb9cf1685d2a052d392d866
Diffstat (limited to 'generic/tclObj.c')
-rw-r--r--generic/tclObj.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 2eb61fd..2e4dc5e 100644
--- a/generic/tclObj.c
+++ b/generic/tclObj.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: tclObj.c,v 1.39 2002/08/14 17:31:43 msofer Exp $
+ * RCS: @(#) $Id: tclObj.c,v 1.40 2002/08/24 01:29:46 msofer Exp $
*/
#include "tclInt.h"
@@ -684,18 +684,22 @@ TclFreeObj(objPtr)
* Tcl_Obj structs we maintain.
*/
- Tcl_MutexLock(&tclObjMutex);
#if defined(TCL_MEM_DEBUG) || defined(PURIFY)
+ Tcl_MutexLock(&tclObjMutex);
ckfree((char *) objPtr);
-#else
+ Tcl_MutexUnlock(&tclObjMutex);
+#elif defined(TCL_THREADS) && defined(USE_THREAD_ALLOC)
+ TclThreadFreeObj(objPtr);
+#else
+ Tcl_MutexLock(&tclObjMutex);
objPtr->internalRep.otherValuePtr = (VOID *) tclFreeObjList;
tclFreeObjList = objPtr;
+ Tcl_MutexUnlock(&tclObjMutex);
#endif /* TCL_MEM_DEBUG */
#ifdef TCL_COMPILE_STATS
tclObjsFreed++;
#endif /* TCL_COMPILE_STATS */
- Tcl_MutexUnlock(&tclObjMutex);
}
/*