summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-04-24 17:50:52 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-04-24 17:50:52 (GMT)
commita80170238fbb5ca2234cb26362941b0d69410df3 (patch)
tree6bda77d44c29351cf7bd3677a801b8cd17533584
parentdc4a6bd185824428dbdbeb43e9ef2888dd8da7c8 (diff)
downloadtcl-a80170238fbb5ca2234cb26362941b0d69410df3.zip
tcl-a80170238fbb5ca2234cb26362941b0d69410df3.tar.gz
tcl-a80170238fbb5ca2234cb26362941b0d69410df3.tar.bz2
* 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].
-rw-r--r--ChangeLog4
-rw-r--r--generic/tclNamesp.c9
2 files changed, 12 insertions, 1 deletions
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 <kennykb@acm.org>
* 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);
}
}
}