fix scheduler memory error on exit

This commit is contained in:
2026-02-20 18:42:21 -06:00
parent ce2e11429f
commit eeb2f038a1
2 changed files with 35 additions and 5 deletions

View File

@@ -182,7 +182,7 @@ function abs_path_to_package(package_dir)
return cfg.package
}
return null
return package_dir
}
// given a file, find the absolute path, package name, and import name
@@ -949,8 +949,9 @@ function try_dylib_symbol(sym, pkg, file_stem) {
var c_file = file_stem + '.c'
var cpp_file = file_stem + '.cpp'
var entry = find(dylibs, function(r) {
return r.file == c_file || r.file == cpp_file
var entry = null
arrfor(dylibs, function(r) {
if (r.file == c_file || r.file == cpp_file) entry = r
})
if (!entry || !entry.dylib) return null
@@ -959,8 +960,8 @@ function try_dylib_symbol(sym, pkg, file_stem) {
handle = os.dylib_open(entry.dylib)
if (handle) open_dls[entry.dylib] = handle
}
if (!handle) return null
if (!os.dylib_has_symbol(handle, sym)) return null
if (!handle) { log.shop(`try_dylib: no handle for ${entry.dylib}`); return null }
if (!os.dylib_has_symbol(handle, sym)) { log.shop(`try_dylib: no symbol ${sym} in ${entry.dylib}`); return null }
log.shop('resolved ' + sym + ' from build cache')
return function() { return os.dylib_symbol(handle, sym) }