forked from cory/tildefriends
Now all the tests run clean.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4804 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
16
src/task.c
16
src/task.c
@ -1596,12 +1596,11 @@ static void _tf_task_signal_shutdown(uv_signal_t* signal, int sig)
|
||||
tf_printf("Interrupted.\n");
|
||||
#endif
|
||||
tf_task_t* task = signal->data;
|
||||
task->_killed = true;
|
||||
if (task->_parent)
|
||||
if (!task->_killed)
|
||||
{
|
||||
tf_packetstream_close(tf_taskstub_get_stream(task->_parent));
|
||||
task->_killed = true;
|
||||
uv_stop(&task->_loop);
|
||||
}
|
||||
uv_stop(&task->_loop);
|
||||
}
|
||||
|
||||
tf_task_t* tf_task_create()
|
||||
@ -1661,6 +1660,7 @@ tf_task_t* tf_task_create()
|
||||
|
||||
void tf_task_configure_from_fd(tf_task_t* task, int fd)
|
||||
{
|
||||
assert(!task->_parent);
|
||||
task->_parent = tf_taskstub_create_parent(task, fd);
|
||||
}
|
||||
|
||||
@ -1769,6 +1769,7 @@ void tf_task_activate(tf_task_t* task)
|
||||
}
|
||||
else
|
||||
{
|
||||
JS_FreeValue(context, tf_taskstub_register(context));
|
||||
tf_trace_set_write_callback(task->_trace, _tf_task_trace_to_parent, task);
|
||||
}
|
||||
|
||||
@ -1831,7 +1832,9 @@ void tf_task_destroy(tf_task_t* task)
|
||||
}
|
||||
if (task->_parent)
|
||||
{
|
||||
JS_FreeValue(task->_context, tf_taskstub_get_task_object(task->_parent));
|
||||
tf_taskstub_destroy(task->_parent);
|
||||
task->_parent = NULL;
|
||||
JS_RunGC(task->_runtime);
|
||||
}
|
||||
while (task->_promise_count)
|
||||
{
|
||||
@ -1936,7 +1939,7 @@ void tf_task_destroy(tf_task_t* task)
|
||||
tf_free(task);
|
||||
if (was_trusted)
|
||||
{
|
||||
tf_printf("Goodbye.");
|
||||
tf_printf("Goodbye.\n");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1987,7 +1990,6 @@ void tf_task_print(tf_task_t* task, int argc, JSValueConst* argv)
|
||||
tf_serialize_store(task, task->_parent, &buffer, &size, array);
|
||||
tf_packetstream_send(tf_taskstub_get_stream(task->_parent), kPrint, buffer, size);
|
||||
tf_free(buffer);
|
||||
|
||||
JS_FreeValue(task->_context, array);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user