summaryrefslogtreecommitdiffstats
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)
commit902d8b663fcd352aa6644345408e762243bf16b4 (patch)
tree807706878210cfe78f526f72b059a1377822aa93
parent9a802144f52e68880cf19da5d66320e4c8aff888 (diff)
downloadtcl-902d8b663fcd352aa6644345408e762243bf16b4.zip
tcl-902d8b663fcd352aa6644345408e762243bf16b4.tar.gz
tcl-902d8b663fcd352aa6644345408e762243bf16b4.tar.bz2
Tweaking some comments for clarity.
-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;