summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2002-08-07 14:24:55 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2002-08-07 14:24:55 (GMT)
commita8fc60bdf11abc47568df177b8c3d80cb96f33db (patch)
tree67f46d928070e97788e9c9d22b48a7fb7dd8aaca
parent662e3f9cf9ef3534b5ac05ea668b44fd912d2180 (diff)
downloadtcl-a8fc60bdf11abc47568df177b8c3d80cb96f33db.zip
tcl-a8fc60bdf11abc47568df177b8c3d80cb96f33db.tar.gz
tcl-a8fc60bdf11abc47568df177b8c3d80cb96f33db.tar.bz2
* generic/tclObj.c (Tcl_NewObj): added conditional code for
USE_THREAD_ALLOC; objects allocated through Tcl_NewObj() were otherwise being leaked. [Bug 587488] reported by Sven Sass.
-rw-r--r--ChangeLog6
-rw-r--r--generic/tclObj.c4
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ae8228e..9344b86 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-08-07 Miguel Sofer <msofer@users.sourceforge.net>
+
+ * generic/tclObj.c (Tcl_NewObj): added conditional code for
+ USE_THREAD_ALLOC; objects allocated through Tcl_NewObj() were
+ otherwise being leaked. [Bug 587488] reported by Sven Sass.
+
2002-08-06 Daniel Steffen <das@users.sourceforge.net>
* generic/tclInt.decls:
diff --git a/generic/tclObj.c b/generic/tclObj.c
index 78581f2..2c5b468 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.35 2002/08/05 03:24:41 dgp Exp $
+ * RCS: @(#) $Id: tclObj.c,v 1.36 2002/08/07 14:25:01 msofer Exp $
*/
#include "tclInt.h"
@@ -523,6 +523,8 @@ Tcl_NewObj()
Tcl_MutexLock(&tclObjMutex);
#ifdef PURIFY
objPtr = (Tcl_Obj *) Tcl_Ckalloc(sizeof(Tcl_Obj));
+#elif defined(TCL_THREADS) && defined(USE_THREAD_ALLOC)
+ objPtr = TclThreadAllocObj();
#else
if (tclFreeObjList == NULL) {
TclAllocateFreeObjects();