summaryrefslogtreecommitdiffstats
path: root/generic/tclOOCall.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/tclOOCall.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/tclOOCall.c')
-rw-r--r--generic/tclOOCall.c10
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;