summaryrefslogtreecommitdiffstats
path: root/generic/tclEnsemble.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-07-06 16:47:37 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-07-06 16:47:37 (GMT)
commit5afe70d02240e1acbe825478808f3ef27847c025 (patch)
tree910ee54327dd35984c3df8f989dc7ea4a550662a /generic/tclEnsemble.c
parent3b1d8286ed07d9ddcea89d5e11497062a77dc85e (diff)
downloadtcl-5afe70d02240e1acbe825478808f3ef27847c025.zip
tcl-5afe70d02240e1acbe825478808f3ef27847c025.tar.gz
tcl-5afe70d02240e1acbe825478808f3ef27847c025.tar.bz2
Create and use a utility Tcl_NRPostProc when decr ref count of values is
all that is needed.
Diffstat (limited to 'generic/tclEnsemble.c')
-rw-r--r--generic/tclEnsemble.c17
1 files changed, 2 insertions, 15 deletions
diff --git a/generic/tclEnsemble.c b/generic/tclEnsemble.c
index fb41580..ee81aee 100644
--- a/generic/tclEnsemble.c
+++ b/generic/tclEnsemble.c
@@ -41,7 +41,6 @@ static int CompileBasicNArgCommand(Tcl_Interp *interp,
Tcl_Parse *parsePtr, Command *cmdPtr,
CompileEnv *envPtr);
-static Tcl_NRPostProc FreeObj;
static Tcl_NRPostProc FreeER;
/*
@@ -1865,7 +1864,7 @@ NsEnsembleImplementationCmdNR(
objv + 2 + ensemblePtr->numParameters);
}
Tcl_IncrRefCount(copyPtr);
- TclNRAddCallback(interp, FreeObj, copyPtr, NULL, NULL, NULL);
+ TclNRAddCallback(interp, TclNRReleaseValues, copyPtr, NULL, NULL, NULL);
TclDecrRefCount(prefixObj);
/*
@@ -2064,18 +2063,6 @@ FreeER(
return result;
}
-static int
-FreeObj(
- ClientData data[],
- Tcl_Interp *interp,
- int result)
-{
- Tcl_Obj *objPtr = (Tcl_Obj *)data[0];
-
- Tcl_DecrRefCount(objPtr);
- return result;
-}
-
void
TclSpellFix(
Tcl_Interp *interp,
@@ -2151,7 +2138,7 @@ TclSpellFix(
store[idx] = fix;
Tcl_IncrRefCount(fix);
- TclNRAddCallback(interp, FreeObj, fix, NULL, NULL, NULL);
+ TclNRAddCallback(interp, TclNRReleaseValues, fix, NULL, NULL, NULL);
}
/*