summaryrefslogtreecommitdiffstats
path: root/generic/tclNamesp.c
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclNamesp.c')
-rw-r--r--generic/tclNamesp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 2aa4aef..34a449d 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -22,7 +22,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclNamesp.c,v 1.125 2007/02/08 18:43:40 dgp Exp $
+ * RCS: @(#) $Id: tclNamesp.c,v 1.126 2007/03/12 19:10:49 dgp Exp $
*/
#include "tclInt.h"
@@ -6308,8 +6308,9 @@ NsEnsembleImplementationCmd(
{
Interp *iPtr = (Interp *) interp;
int isRootEnsemble = (iPtr->ensembleRewrite.sourceObjs == NULL);
+ Tcl_Obj *copyObj = TclListObjCopy(NULL, prefixObj);
- Tcl_ListObjGetElements(NULL, prefixObj, &prefixObjc, &prefixObjv);
+ Tcl_ListObjGetElements(NULL, copyObj, &prefixObjc, &prefixObjv);
if (isRootEnsemble) {
iPtr->ensembleRewrite.sourceObjs = objv;
iPtr->ensembleRewrite.numRemovedObjs = 2;
@@ -6329,6 +6330,7 @@ NsEnsembleImplementationCmd(
memcpy(tempObjv+prefixObjc, objv+2, sizeof(Tcl_Obj *) * (objc-2));
result = Tcl_EvalObjv(interp, objc-2+prefixObjc, tempObjv,
TCL_EVAL_INVOKE);
+ Tcl_DecrRefCount(copyObj);
Tcl_DecrRefCount(prefixObj);
TclStackFree(interp);
if (isRootEnsemble) {