Don't leak the http handlers.
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4801 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
@ -1838,6 +1838,15 @@ void tf_task_destroy(tf_task_t* task)
|
||||
{
|
||||
tf_ssb_destroy(task->_ssb);
|
||||
}
|
||||
|
||||
/* This ensures the HTTP handlers get cleaned up. */
|
||||
if (task->_trusted)
|
||||
{
|
||||
JSValue global = JS_GetGlobalObject(task->_context);
|
||||
JS_SetPropertyStr(task->_context, global, "httpd", JS_UNDEFINED);
|
||||
JS_FreeValue(task->_context, global);
|
||||
}
|
||||
|
||||
JS_FreeContext(task->_context);
|
||||
JS_FreeRuntime(task->_runtime);
|
||||
|
||||
|
Reference in New Issue
Block a user