summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2004-10-21 15:19:43 (GMT)
committerdgp <dgp@users.sourceforge.net>2004-10-21 15:19:43 (GMT)
commit302b35c0ac3658a27a30f795d3229e8a43eb5379 (patch)
tree876886b2a00fbe951800502983cfa1c7e9edc97b /generic/tclBasic.c
parent0e16d1cc7dd629f7bb9a3d1af174b072e9c8ae6c (diff)
downloadtcl-302b35c0ac3658a27a30f795d3229e8a43eb5379.zip
tcl-302b35c0ac3658a27a30f795d3229e8a43eb5379.tar.gz
tcl-302b35c0ac3658a27a30f795d3229e8a43eb5379.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.c9
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);