From a8fc60bdf11abc47568df177b8c3d80cb96f33db Mon Sep 17 00:00:00 2001 From: Miguel Sofer Date: Wed, 7 Aug 2002 14:24:55 +0000 Subject: * 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. --- ChangeLog | 6 ++++++ generic/tclObj.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ae8228e..9344b86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-08-07 Miguel Sofer + + * 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 * 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(); -- cgit v0.12