Is this a thing? Ref a value while we call it?
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3931 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
e6532979aa
commit
ae5560f33a
@ -291,12 +291,14 @@ static void _taskstub_on_process_exit(uv_process_t* process, int64_t status, int
|
|||||||
JSContext* context = tf_task_get_context(stub->_owner);
|
JSContext* context = tf_task_get_context(stub->_owner);
|
||||||
if (!JS_IsUndefined(stub->_on_exit))
|
if (!JS_IsUndefined(stub->_on_exit))
|
||||||
{
|
{
|
||||||
|
JSValue ref = JS_DupValue(context, stub->_on_exit);
|
||||||
JSValue argv[] = { JS_NewInt32(context, status), JS_NewInt32(context, terminationSignal) };
|
JSValue argv[] = { JS_NewInt32(context, status), JS_NewInt32(context, terminationSignal) };
|
||||||
JSValue result = JS_Call(context, stub->_on_exit, JS_NULL, 2, argv);
|
JSValue result = JS_Call(context, stub->_on_exit, JS_NULL, 2, argv);
|
||||||
tf_util_report_error(context, result);
|
tf_util_report_error(context, result);
|
||||||
JS_FreeValue(context, result);
|
JS_FreeValue(context, result);
|
||||||
JS_FreeValue(context, argv[0]);
|
JS_FreeValue(context, argv[0]);
|
||||||
JS_FreeValue(context, argv[1]);
|
JS_FreeValue(context, argv[1]);
|
||||||
|
JS_FreeValue(context, ref);
|
||||||
}
|
}
|
||||||
if (stub->_stream)
|
if (stub->_stream)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user