summaryrefslogtreecommitdiffstats
path: root/generic/tclOO.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2018-03-11 18:08:00 (GMT)
committerdgp <dgp@users.sourceforge.net>2018-03-11 18:08:00 (GMT)
commitcd39f34fa58e57741ef315b5f9587783ea6331a3 (patch)
tree3adb27a8630d2ef9ead32056a7002c8121bda470 /generic/tclOO.c
parenta0374a6e61102ea76e2df357b648e1530508a973 (diff)
downloadtcl-cd39f34fa58e57741ef315b5f9587783ea6331a3.zip
tcl-cd39f34fa58e57741ef315b5f9587783ea6331a3.tar.gz
tcl-cd39f34fa58e57741ef315b5f9587783ea6331a3.tar.bz2
Attempt at providing the missing instance squelcher.
Diffstat (limited to 'generic/tclOO.c')
-rw-r--r--generic/tclOO.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/generic/tclOO.c b/generic/tclOO.c
index c6ea91d..556ad80 100644
--- a/generic/tclOO.c
+++ b/generic/tclOO.c
@@ -934,10 +934,26 @@ ReleaseClassContents(
TclDecrRefCount(filterObj);
}
ckfree(clsPtr->filters.list);
+ clsPtr->filters.list = NULL;
clsPtr->filters.num = 0;
}
/*
+ * Squelch our instances.
+ */
+
+ if (clsPtr->instances.num) {
+ Object *oPtr;
+
+ FOREACH(oPtr, clsPtr->instances) {
+ TclOODecrRefCount(oPtr);
+ }
+ ckfree(clsPtr->instances.list);
+ clsPtr->instances.list = NULL;
+ clsPtr->instances.num = 0;
+ }
+
+ /*
* Squelch our metadata.
*/