summaryrefslogtreecommitdiffstats
path: root/generic/tclOOBasic.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2011-03-01 15:07:56 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2011-03-01 15:07:56 (GMT)
commit50c2ad2dd25382a1534ce3666f7ff99653aa512d (patch)
tree17e5353ce79764e0a8112158a256b8544e312a9c /generic/tclOOBasic.c
parentcd34f84f42b4e64866a9177553e91417ded252a0 (diff)
downloadtcl-50c2ad2dd25382a1534ce3666f7ff99653aa512d.zip
tcl-50c2ad2dd25382a1534ce3666f7ff99653aa512d.tar.gz
tcl-50c2ad2dd25382a1534ce3666f7ff99653aa512d.tar.bz2
Reorganization of call context reference count management so that code
is (mostly) simpler.
Diffstat (limited to 'generic/tclOOBasic.c')
-rw-r--r--generic/tclOOBasic.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/generic/tclOOBasic.c b/generic/tclOOBasic.c
index b26061e..7e9dc29 100644
--- a/generic/tclOOBasic.c
+++ b/generic/tclOOBasic.c
@@ -4,12 +4,10 @@
* This file contains implementations of the "simple" commands and
* methods from the object-system core.
*
- * Copyright (c) 2005-2008 by Donal K. Fellows
+ * Copyright (c) 2005-2011 by Donal K. Fellows
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
- *
- * RCS: @(#) $Id: tclOOBasic.c,v 1.24 2010/02/05 13:41:33 dkf Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -278,9 +276,8 @@ TclOO_Object_Destroy(
if (contextPtr != NULL) {
contextPtr->callPtr->flags |= DESTRUCTOR;
contextPtr->skip = 0;
- AddRef(oPtr);
- TclNRAddCallback(interp, AfterNRDestructor, oPtr, contextPtr,
- NULL, NULL);
+ TclNRAddCallback(interp, AfterNRDestructor, contextPtr,
+ NULL, NULL, NULL);
return TclOOInvokeContext(contextPtr, interp, 0, NULL);
}
}
@@ -296,14 +293,12 @@ AfterNRDestructor(
Tcl_Interp *interp,
int result)
{
- Object *oPtr = data[0];
- CallContext *contextPtr = data[1];
+ CallContext *contextPtr = data[0];
- TclOODeleteContext(contextPtr);
- if (oPtr->command) {
- Tcl_DeleteCommandFromToken(interp, oPtr->command);
+ if (contextPtr->oPtr->command) {
+ Tcl_DeleteCommandFromToken(interp, contextPtr->oPtr->command);
}
- DelRef(oPtr);
+ TclOODeleteContext(contextPtr);
return result;
}