diff options
author | dkf <dkf@noemail.net> | 2011-03-01 15:07:56 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2011-03-01 15:07:56 (GMT) |
commit | 1212a4636e32ba0f325474c8f838eb3757021fff (patch) | |
tree | 17e5353ce79764e0a8112158a256b8544e312a9c /generic/tclOOCall.c | |
parent | 31c7d5869ce8e7a41212326b2ab356a8cc4d6bc4 (diff) | |
download | tcl-1212a4636e32ba0f325474c8f838eb3757021fff.zip tcl-1212a4636e32ba0f325474c8f838eb3757021fff.tar.gz tcl-1212a4636e32ba0f325474c8f838eb3757021fff.tar.bz2 |
Reorganization of call context reference count management so that code
is (mostly) simpler.
FossilOrigin-Name: 25d2a66f4de7efec148a46f106297b860ac2d5bd
Diffstat (limited to 'generic/tclOOCall.c')
-rw-r--r-- | generic/tclOOCall.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/generic/tclOOCall.c b/generic/tclOOCall.c index e8f9757..292e9e0 100644 --- a/generic/tclOOCall.c +++ b/generic/tclOOCall.c @@ -4,12 +4,10 @@ * This file contains the method call chain management code for 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: tclOOCall.c,v 1.15 2009/09/30 03:11:26 dgp Exp $ */ #ifdef HAVE_CONFIG_H @@ -103,8 +101,11 @@ void TclOODeleteContext( CallContext *contextPtr) { + register Object oPtr = contextPtr->oPtr; + TclOODeleteChain(contextPtr->callPtr); - TclStackFree(contextPtr->oPtr->fPtr->interp, contextPtr); + TclStackFree(oPtr->fPtr->interp, contextPtr); + DelRef(oPtr); } /* @@ -1089,6 +1090,7 @@ TclOOGetCallContext( returnContext: contextPtr = TclStackAlloc(oPtr->fPtr->interp, sizeof(CallContext)); contextPtr->oPtr = oPtr; + AddRef(oPtr); contextPtr->callPtr = callPtr; contextPtr->skip = 2; contextPtr->index = 0; |