diff options
| author | dgp@users.sourceforge.net <dgp> | 2004-10-21 15:19:43 (GMT) |
|---|---|---|
| committer | dgp@users.sourceforge.net <dgp> | 2004-10-21 15:19:43 (GMT) |
| commit | 2c410e63c6e95c91f2431c66061ce770db1bed2e (patch) | |
| tree | 876886b2a00fbe951800502983cfa1c7e9edc97b /generic/tclBasic.c | |
| parent | 548522205f014e987c1fd6cd4fc05b91b5f4359e (diff) | |
| download | tcl-2c410e63c6e95c91f2431c66061ce770db1bed2e.zip tcl-2c410e63c6e95c91f2431c66061ce770db1bed2e.tar.gz tcl-2c410e63c6e95c91f2431c66061ce770db1bed2e.tar.bz2 | |
* generic/tclCmdAH.c (Tcl_CatchObjCmd, Tcl_ErrorObjCmd):
Updated to call the new TclGet/SetReturnOptions routines to do
much of their work.
* generic/tclInt.h (TclGetReturnOptions,TclSetReturnOptions):
* generic/tclResult.c (TclGetReturnOptions,TclSetReturnOptions):
New utility routines to get/set the return options of an interp.
Intent is that these routines will be converted to public routines
after TIP approval.
* generic/tclCmdMZ.c (TclProcessReturn,TclMergeReturnOptions):
* generic/tclResult.c (TclProcessReturn,TclMergeReturnOptions):
Move internal utility routines from tclCmdMZ.c to tclResult.c.
* generic/tclBasic.c (Tcl_CreateInterp, Tcl_DeleteInterp):
* generic/tclResult.c (TclTransferResult): Rework so that
iPtr->returnOpts can be NULL when there are no special options.
* generic/tclResult.c (TclRestoreInterpState): Plug potential
memory leak.
Diffstat (limited to 'generic/tclBasic.c')
| -rw-r--r-- | generic/tclBasic.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 1a370bc..7451b69 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.130 2004/10/21 03:53:04 kennykb Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.131 2004/10/21 15:19:46 dgp Exp $ */ #include "tclInt.h" @@ -233,8 +233,7 @@ Tcl_CreateInterp() Tcl_IncrRefCount(iPtr->returnLevelKey); iPtr->returnOptionsKey = Tcl_NewStringObj("-options",-1); Tcl_IncrRefCount(iPtr->returnOptionsKey); - iPtr->returnOpts = Tcl_NewObj(); - Tcl_IncrRefCount(iPtr->returnOpts); + iPtr->returnOpts = NULL; iPtr->errorInfo = NULL; iPtr->eiVar = Tcl_NewStringObj("errorInfo", -1); Tcl_IncrRefCount(iPtr->eiVar); @@ -992,7 +991,9 @@ DeleteInterpProc(interp) Tcl_DecrRefCount(iPtr->errorInfo); iPtr->errorInfo = NULL; } - Tcl_DecrRefCount(iPtr->returnOpts); + if (iPtr->returnOpts) { + Tcl_DecrRefCount(iPtr->returnOpts); + } Tcl_DecrRefCount(iPtr->returnCodeKey); Tcl_DecrRefCount(iPtr->returnErrorcodeKey); Tcl_DecrRefCount(iPtr->returnErrorinfoKey); |
