faster startup and fix asan error

This commit is contained in:
2026-02-19 03:47:30 -06:00
parent 06ad466b1a
commit 38f368c6d6
5 changed files with 21 additions and 23 deletions

View File

@@ -34,14 +34,10 @@
static JSClassID js_dylib_class_id;
static void js_dylib_finalizer(JSRuntime *rt, JSValue val) {
void *handle = JS_GetOpaque(val, js_dylib_class_id);
if (handle) {
#ifdef _WIN32
FreeLibrary((HMODULE)handle);
#else
dlclose(handle);
#endif
}
/* Do NOT dlclose here. Loaded dylibs contain finalizer functions for other
JS objects; if the dylib is freed before those objects during
JS_FreeContext teardown, calling their finalizers would SEGV.
The OS reclaims all loaded libraries on process exit. */
}
static JSClassDef js_dylib_class = {