Fix some script bugs

This commit is contained in:
2026-06-07 18:47:34 -05:00
parent ed0420fdce
commit f8c9d33df2
8 changed files with 60 additions and 32 deletions
@@ -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;
+6
View File
@@ -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;