forked from cory/tildefriends
Rudimentary support for building the executable with data attached. Pushed some things around in the makefile to fix issues along the way. #46
This commit is contained in:
@ -316,7 +316,9 @@ static void _file_read_file_zip_after_work(uv_work_t* work, int status)
|
||||
tf_trace_begin(trace, "file_read_zip_after_work");
|
||||
if (data->result >= 0)
|
||||
{
|
||||
tf_task_resolve_promise(data->task, data->promise, tf_util_new_uint8_array(data->context, data->buffer, data->result));
|
||||
JSValue array = tf_util_new_uint8_array(data->context, data->buffer, data->result);
|
||||
tf_task_resolve_promise(data->task, data->promise, array);
|
||||
JS_FreeValue(data->context, array);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -412,6 +412,7 @@ static int _tf_command_run(const char* file, int argc, char* argv[])
|
||||
.http_port = 12345,
|
||||
.https_port = 12346,
|
||||
.ssb_port = 8008,
|
||||
.zip = file,
|
||||
.db_path = k_db_path_default,
|
||||
};
|
||||
bool show_usage = false;
|
||||
|
@ -1939,6 +1939,11 @@ void tf_task_destroy(tf_task_t* task)
|
||||
tf_free(task->_promise_stacks);
|
||||
tf_free((void*)task->_path);
|
||||
bool was_trusted = task->_trusted;
|
||||
if (task->_zip)
|
||||
{
|
||||
unzClose(task->_zip);
|
||||
task->_zip = NULL;
|
||||
}
|
||||
tf_free(task);
|
||||
if (was_trusted)
|
||||
{
|
||||
|
Reference in New Issue
Block a user