diff options
| author | Kevin B Kenny <kennykb@acm.org> | 2011-03-05 16:31:26 (GMT) |
|---|---|---|
| committer | Kevin B Kenny <kennykb@acm.org> | 2011-03-05 16:31:26 (GMT) |
| commit | e5eafc26411072617eb6671161e84ddfbbf99bba (patch) | |
| tree | 63741735edd48be8ee7aa9bfe8b32092b1d94fb8 /generic/tclOOMethod.c | |
| parent | 7e907ec87a885ad9d187dbc73741df94519b73ed (diff) | |
| parent | bc47f3260fa46a560c1a2e7e1a0891e5493cda50 (diff) | |
| download | tcl-e5eafc26411072617eb6671161e84ddfbbf99bba.zip tcl-e5eafc26411072617eb6671161e84ddfbbf99bba.tar.gz tcl-e5eafc26411072617eb6671161e84ddfbbf99bba.tar.bz2 | |
merge trunkdogeen_assembler_branch
Diffstat (limited to 'generic/tclOOMethod.c')
| -rw-r--r-- | generic/tclOOMethod.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c index bb10ca5..4f29337 100644 --- a/generic/tclOOMethod.c +++ b/generic/tclOOMethod.c @@ -7,8 +7,6 @@ * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. - * - * RCS: @(#) $Id: tclOOMethod.c,v 1.31 2011/01/18 15:44:41 dkf Exp $ */ #ifdef HAVE_CONFIG_H @@ -1057,6 +1055,14 @@ ProcedureMethodCompiledVarConnect( } if (cacheIt) { infoPtr->cachedObjectVar = TclVarHashGetValue(hPtr); + + /* + * We must keep a reference to the variable so everything will + * continue to work correctly even if it is unset; being unset does + * not end the life of the variable at this level. [Bug 3185009] + */ + + VarHashRefCount(infoPtr->cachedObjectVar)++; } return TclVarHashGetValue(hPtr); } @@ -1067,6 +1073,14 @@ ProcedureMethodCompiledVarDelete( { OOResVarInfo *infoPtr = (OOResVarInfo *) rPtr; + /* + * Release the reference to the variable if we were holding it. + */ + + if (infoPtr->cachedObjectVar) { + VarHashRefCount(infoPtr->cachedObjectVar)--; + TclCleanupVar((Var *) infoPtr->cachedObjectVar, NULL); + } Tcl_DecrRefCount(infoPtr->variableObj); ckfree((char *) infoPtr); } |
