summaryrefslogtreecommitdiffstats
path: root/generic/tclOO.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclOO.c')
-rw-r--r--generic/tclOO.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tclOO.c b/generic/tclOO.c
index ec666ee..f236ac9 100644
--- a/generic/tclOO.c
+++ b/generic/tclOO.c
@@ -537,7 +537,8 @@ KillFoundation(
* AllocObject --
*
* Allocate an object of basic type. Does not splice the object into its
- * class's instance list.
+ * class's instance list. The caller must set the classPtr on the object,
+ * either to a class or to NULL.
*
* ----------------------------------------------------------------------
*/
@@ -1672,6 +1673,8 @@ Tcl_NewObjectInstance(
AllocClass(interp, oPtr);
oPtr->selfCls = classPtr;
TclOOAddToSubclasses(oPtr->classPtr, fPtr->objectCls);
+ } else {
+ oPtr->classPtr = NULL;
}
/*