summaryrefslogtreecommitdiffstats
path: root/generic/tclOO.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2015-05-15 13:54:52 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2015-05-15 13:54:52 (GMT)
commitd52ef74d40e9ea437e953e3f7d5ea021324b3b9e (patch)
treecc264c27ab55b00dfc7696ee502ec9afabf2dfb3 /generic/tclOO.c
parent0785ac4c8918cc64f8298aee9629017fc17ba86c (diff)
downloadtcl-d52ef74d40e9ea437e953e3f7d5ea021324b3b9e.zip
tcl-d52ef74d40e9ea437e953e3f7d5ea021324b3b9e.tar.gz
tcl-d52ef74d40e9ea437e953e3f7d5ea021324b3b9e.tar.bz2
[9dd1bd7a74] Ensure that [self] returns a sensible value in a destructor even when construction didn't complete.
Diffstat (limited to 'generic/tclOO.c')
-rw-r--r--generic/tclOO.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/generic/tclOO.c b/generic/tclOO.c
index 77e668b..e2ef1ae 100644
--- a/generic/tclOO.c
+++ b/generic/tclOO.c
@@ -1675,10 +1675,13 @@ Tcl_NewObjectInstance(
/*
* Take care to not delete a deleted object; that would be
- * bad. [Bug 2903011]
+ * bad. [Bug 2903011] Also take care to make sure that we have
+ * the name of the command before we delete it. [Bug
+ * 9dd1bd7a74]
*/
if (!Deleted(oPtr)) {
+ (void) TclOOObjectName(interp, oPtr);
Tcl_DeleteCommandFromToken(interp, oPtr->command);
}
return NULL;
@@ -1821,10 +1824,12 @@ FinalizeAlloc(
/*
* Take care to not delete a deleted object; that would be bad. [Bug
- * 2903011]
+ * 2903011] Also take care to make sure that we have the name of the
+ * command before we delete it. [Bug 9dd1bd7a74]
*/
if (!Deleted(oPtr)) {
+ (void) TclOOObjectName(interp, oPtr);
Tcl_DeleteCommandFromToken(interp, oPtr->command);
}
DelRef(oPtr);