Add ecma_free_all_enqueued_jobs function (#2265)

This function releases any remaining promise job that wasn't completed.
Also added this function to `jerry_cleanup ()`, therefore it will be automatically run.

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This commit is contained in:
Daniel Balla
2018-04-05 09:49:25 +02:00
committed by László Langó
parent 634d9d38da
commit f06d637238
3 changed files with 21 additions and 0 deletions
+3
View File
@@ -222,6 +222,9 @@ jerry_cleanup (void)
jmem_heap_free_block (this_p, sizeof (jerry_context_data_header_t) + this_p->manager_p->bytes_needed);
}
#ifndef CONFIG_DISABLE_ES2015_PROMISE_BUILTIN
ecma_free_all_enqueued_jobs ();
#endif /* CONFIG_DISABLE_ES2015_PROMISE_BUILTIN */
ecma_finalize ();
jmem_finalize ();
jerry_make_api_unavailable ();