summaryrefslogtreecommitdiffstats
path: root/generic/tclOOMethod.c
diff options
context:
space:
mode:
authormsofer <msofer@noemail.net>2008-07-29 05:30:25 (GMT)
committermsofer <msofer@noemail.net>2008-07-29 05:30:25 (GMT)
commitb422512a4145452e42fb9f649b40bf8cefbecb17 (patch)
tree4c1271ec62dc5e1d48fc5559a5b9e8320ba3522a /generic/tclOOMethod.c
parent0421381590ba3bdfbf50bf66ce2b00c611532b9f (diff)
downloadtcl-b422512a4145452e42fb9f649b40bf8cefbecb17.zip
tcl-b422512a4145452e42fb9f649b40bf8cefbecb17.tar.gz
tcl-b422512a4145452e42fb9f649b40bf8cefbecb17.tar.bz2
Completely revamped NRE implementation, with (almost) unchanged API.
FossilOrigin-Name: 4c5c243ec39b9eca18031add6602feb4534a6210
Diffstat (limited to 'generic/tclOOMethod.c')
-rw-r--r--generic/tclOOMethod.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c
index 8ce3c34..9cd2678 100644
--- a/generic/tclOOMethod.c
+++ b/generic/tclOOMethod.c
@@ -8,7 +8,7 @@
* 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.10 2008/07/27 22:28:54 dkf Exp $
+ * RCS: @(#) $Id: tclOOMethod.c,v 1.11 2008/07/29 05:30:37 msofer Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -55,6 +55,8 @@ static Tcl_Obj ** InitEnsembleRewrite(Tcl_Interp *interp, int objc,
static int InvokeProcedureMethod(ClientData clientData,
Tcl_Interp *interp, Tcl_ObjectContext context,
int objc, Tcl_Obj *const *objv);
+static int FinalizeForwardCall(ClientData data[], Tcl_Interp *interp,
+ int result);
static int FinalizePMCall(ClientData data[], Tcl_Interp *interp,
int result);
static int PushMethodCallFrame(Tcl_Interp *interp,
@@ -1131,7 +1133,7 @@ InvokeForwardMethod(
CallContext *contextPtr = (CallContext *) context;
ForwardMethod *fmPtr = clientData;
Tcl_Obj **argObjs, **prefixObjs;
- int numPrefixes, result, len, skip = contextPtr->skip;
+ int numPrefixes, len, skip = contextPtr->skip;
/*
* Build the real list of arguments to use. Note that we know that the
@@ -1144,7 +1146,18 @@ InvokeForwardMethod(
argObjs = InitEnsembleRewrite(interp, objc, objv, skip,
numPrefixes, prefixObjs, &len);
- result = Tcl_NREvalObjv(interp, len, argObjs, TCL_EVAL_INVOKE);
+ Tcl_NRAddCallback(interp, FinalizeForwardCall, argObjs, NULL, NULL, NULL);
+ return Tcl_NREvalObjv(interp, len, argObjs, TCL_EVAL_INVOKE);
+}
+
+static int
+FinalizeForwardCall(
+ ClientData data[],
+ Tcl_Interp *interp,
+ int result)
+{
+ Tcl_Obj **argObjs = data[0];
+
TclStackFree(interp, argObjs);
return result;
}