diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2011-03-01 15:07:56 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2011-03-01 15:07:56 (GMT) |
commit | 1be406c3806f7315060d35eddb4440a5525ced86 (patch) | |
tree | 17e5353ce79764e0a8112158a256b8544e312a9c /generic/tclOOBasic.c | |
parent | 015a89a620578c6cec602776b06786bdee29b8a0 (diff) | |
download | tcl-1be406c3806f7315060d35eddb4440a5525ced86.zip tcl-1be406c3806f7315060d35eddb4440a5525ced86.tar.gz tcl-1be406c3806f7315060d35eddb4440a5525ced86.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.c | 19 |
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; } |