summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2016-02-05 16:31:00 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2016-02-05 16:31:00 (GMT)
commitb1598dbddda53d7d5886bc8ae50a5b2f8901a1d8 (patch)
tree807706878210cfe78f526f72b059a1377822aa93 /generic
parentdba2afb18ab071ead67a0d02265405609a89f87c (diff)
downloadtcl-b1598dbddda53d7d5886bc8ae50a5b2f8901a1d8.zip
tcl-b1598dbddda53d7d5886bc8ae50a5b2f8901a1d8.tar.gz
tcl-b1598dbddda53d7d5886bc8ae50a5b2f8901a1d8.tar.bz2
Tweaking some comments for clarity.
Diffstat (limited to 'generic')
-rw-r--r--generic/tclOO.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/generic/tclOO.c b/generic/tclOO.c
index 4697054..9df5029 100644
--- a/generic/tclOO.c
+++ b/generic/tclOO.c
@@ -898,10 +898,10 @@ ObjectRenamedTrace(
/*
* ----------------------------------------------------------------------
*
- * ReleaseClassContents --
+ * ClearMixins, ClearSuperclasses --
*
- * Tear down the special class data structure, including deleting all
- * dependent classes and objects.
+ * Utility functions for correctly clearing the list of mixins or
+ * superclasses of a class. Will ckfree() the list storage.
*
* ----------------------------------------------------------------------
*/
@@ -921,6 +921,7 @@ ClearMixins(
TclOORemoveFromMixinSubs(clsPtr, mixinPtr);
}
ckfree(clsPtr->mixins.list);
+ clsPtr->mixins.list = NULL;
clsPtr->mixins.num = 0;
}
@@ -939,8 +940,20 @@ ClearSuperclasses(
TclOORemoveFromSubclasses(clsPtr, superPtr);
}
ckfree(clsPtr->superclasses.list);
+ clsPtr->superclasses.list = NULL;
clsPtr->superclasses.num = 0;
}
+
+/*
+ * ----------------------------------------------------------------------
+ *
+ * ReleaseClassContents --
+ *
+ * Tear down the special class data structure, including deleting all
+ * dependent classes and objects.
+ *
+ * ----------------------------------------------------------------------
+ */
static void
ReleaseClassContents(
@@ -1231,6 +1244,10 @@ ObjectNamespaceDeleted(
oPtr->metadataPtr = NULL;
}
+ /*
+ * If this was a class, there's additional deletion work to do.
+ */
+
if (clsPtr != NULL) {
Tcl_ObjectMetadataType *metadataTypePtr;
ClientData value;