Fix some script bugs
This commit is contained in:
@@ -253,6 +253,7 @@ moduleBaseFunction(moduleAssetBatchLock) {
|
||||
moduleBaseFunction(moduleAssetBatchUnlock) {
|
||||
jsassetbatch_t *b = moduleAssetBatchSelf(callInfo);
|
||||
if(!b || !b->batch) return jerry_undefined();
|
||||
assetBatchUnlock(b->batch);
|
||||
assetBatchDispose(b->batch);
|
||||
memoryFree(b->batch);
|
||||
b->batch = NULL;
|
||||
|
||||
@@ -128,6 +128,12 @@ errorret_t scriptDispose(void) {
|
||||
"All script assets should be disposed by now."
|
||||
);
|
||||
|
||||
// Script modules are now freed, so any JS objects that were only reachable
|
||||
// through module-scope globals (texEntry, renderable._tex, etc.) are now
|
||||
// orphaned. A GC pass here fires their finalizers and releases asset entry
|
||||
// locks before assetDispose() checks ref counts.
|
||||
jerry_heap_gc(JERRY_GC_PRESSURE_HIGH);
|
||||
|
||||
moduleListDispose();
|
||||
jerry_cleanup();
|
||||
SCRIPT.initialized = false;
|
||||
|
||||
Reference in New Issue
Block a user