Displaying 1 result from an estimated 1 matches for "r_trigger_callback1".
Did you mean:
r_trigger_callback2
2009 Jan 08
1
Callbacks seems to get GCed.
...func);
}
void set_callback2(SEXP func) {
PROTECT(callback2 = func);
}
R_CMethodDef cMethods[] = {
{NULL}
};
R_CallMethodDef callMethods[] = {
{"set_callback1", (DL_FUNC) &set_callback1, 1},
{"set_callback2", (DL_FUNC) &set_callback2, 1},
{NULL}
};
void r_trigger_callback1()
{
int errorOccurred;
SEXP f = NULL;
f = allocVector(LANGSXP, 1);
SETCAR(f, callback1);
PROTECT(f);
R_tryEval(f, R_GlobalEnv, &errorOccurred);
UNPROTECT(1);
}
void r_trigger_callback2()
{
int errorOccurred;
SEXP f = NULL;
f = allocVector(LANGSXP, 1);
SETCAR(...