faster startup and fix asan error
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user