summaryrefslogtreecommitdiffstats
path: root/generic/tclOO.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclOO.c')
-rw-r--r--generic/tclOO.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/generic/tclOO.c b/generic/tclOO.c
index ace47fe..77e668b 100644
--- a/generic/tclOO.c
+++ b/generic/tclOO.c
@@ -1287,7 +1287,9 @@ TclOORemoveFromInstances(
removeInstance:
if (Deleted(clsPtr->thisPtr)) {
- DelRef(clsPtr->instances.list[i]);
+ if (!IsRootClass(clsPtr)) {
+ DelRef(clsPtr->instances.list[i]);
+ }
clsPtr->instances.list[i] = NULL;
} else {
clsPtr->instances.num--;