We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b78f90 commit 9c482b8Copy full SHA for 9c482b8
NativeScript/runtime/ModuleInternalCallbacks.mm
@@ -391,7 +391,12 @@ static bool IsNodeBuiltinModule(const std::string& moduleName) {
391
return v8::MaybeLocal<v8::Module>();
392
}
393
394
- // Store in registry and return
+ // Store in registry and return - with safe Global handle management
395
+ auto it = g_moduleRegistry.find(absPath);
396
+ if (it != g_moduleRegistry.end()) {
397
+ // Clear the existing Global handle before replacing it
398
+ it->second.Reset();
399
+ }
400
g_moduleRegistry[absPath].Reset(isolate, jsonModule);
401
return v8::MaybeLocal<v8::Module>(jsonModule);
402
0 commit comments