From b1598dbddda53d7d5886bc8ae50a5b2f8901a1d8 Mon Sep 17 00:00:00 2001 From: dkf Date: Fri, 5 Feb 2016 16:31:00 +0000 Subject: Tweaking some comments for clarity. --- generic/tclOO.c | 23 ++++++++++++++++++++--- 1 file 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; -- cgit v0.12