summaryrefslogtreecommitdiffstats
path: root/generic/tclNamesp.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-02-08 18:43:39 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-02-08 18:43:39 (GMT)
commit5f3752c577b76184a8548e74176f2fa153842de9 (patch)
treea5d163800f404b2adc298006d04a55765032f8ce /generic/tclNamesp.c
parentd61e710b3e5c9a793544571f3b124acca5bdf882 (diff)
downloadtcl-5f3752c577b76184a8548e74176f2fa153842de9.zip
tcl-5f3752c577b76184a8548e74176f2fa153842de9.tar.gz
tcl-5f3752c577b76184a8548e74176f2fa153842de9.tar.bz2
* generic/tclNamesp.c: Corrected broken logic in Tcl_DeleteNamespace()
* tests/namespace.test: introduced in Patch 1577278 that caused [namespace delete ::] to be effective only at level #0. New test namespace-7.7 should prevent similar error in the future. [Bug 1655305]
Diffstat (limited to 'generic/tclNamesp.c')
-rw-r--r--generic/tclNamesp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index fb0570f..2aa4aef 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.124 2007/02/06 23:43:49 dkf Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.125 2007/02/08 18:43:40 dgp Exp $
*/
#include "tclInt.h"
@@ -505,7 +505,8 @@ Tcl_PopCallFrame(
nsPtr = framePtr->nsPtr;
nsPtr->activationCount--;
- if ((nsPtr->flags & NS_DYING) && (nsPtr->activationCount == 0)) {
+ if ((nsPtr->flags & NS_DYING)
+ && (nsPtr->activationCount - (nsPtr == iPtr->globalNsPtr) == 0)) {
Tcl_DeleteNamespace((Tcl_Namespace *) nsPtr);
}
framePtr->nsPtr = NULL;
@@ -967,8 +968,7 @@ Tcl_DeleteNamespace(
* refCount reaches 0.
*/
- if ((nsPtr->activationCount > 0)
- && !((nsPtr == globalNsPtr) && (nsPtr->activationCount == 1))) {
+ if (nsPtr->activationCount - (nsPtr == globalNsPtr) > 0) {
nsPtr->flags |= NS_DYING;
if (nsPtr->parentPtr != NULL) {
entryPtr = Tcl_FindHashEntry(&nsPtr->parentPtr->childTable,