From a80170238fbb5ca2234cb26362941b0d69410df3 Mon Sep 17 00:00:00 2001 From: dgp Date: Tue, 24 Apr 2007 17:50:52 +0000 Subject: * generic/tclNamesp.c (Tcl_DeleteNamespace): Corrected flaw in the flag marking scheme to be sure that global namespaces are freed when their interp is deleted. [Bug 1705778]. --- ChangeLog | 4 ++++ generic/tclNamesp.c | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d0eabf3..0081711 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,6 +15,10 @@ * generic/tclCompExpr.c (ParseExpr): Memory leak in error case; the literal Tcl_Obj was not getting freed. [Bug 1705778, leak #1 (new)] + * generic/tclNamesp.c (Tcl_DeleteNamespace): Corrected flaw in the + flag marking scheme to be sure that global namespaces are freed when + their interp is deleted. [Bug 1705778]. + 2007-04-24 Kevin B. Kenny * generic/tclExecute.c (TclExecuteByteCode): Plugged six memory diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index b4c7a4a..3f6ecf8 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -22,7 +22,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclNamesp.c,v 1.132 2007/04/20 06:10:58 kennykb Exp $ + * RCS: @(#) $Id: tclNamesp.c,v 1.133 2007/04/24 17:50:53 dgp Exp $ */ #include "tclInt.h" @@ -1035,6 +1035,13 @@ Tcl_DeleteNamespace( EstablishErrorInfoTraces(NULL, nsPtr->interp, NULL, NULL, 0); EstablishErrorCodeTraces(NULL, nsPtr->interp, NULL, NULL, 0); + + /* + * We didn't really kill it, so remove the KILLED marks, so + * it can get killed later, avoiding mem leaks + */ + + nsPtr->flags &= ~(NS_DYING|NS_KILLED); } } } -- cgit v0.12