Skip to content

fix: revert commeted lock_gc_release #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/api/isolate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,9 @@ IsolateWrap::IsolateWrap() {

threadManager_ = new ThreadManager();

// NOTE: check lock_gc_release(); is needed (and where)
// lock_gc_release();
// The following ensures this instance is retained using PersistentHolder.
lock_gc_release();

Memory::gcRegisterFinalizer(this, [](void* self) {
reinterpret_cast<IsolateWrap*>(self)->~IsolateWrap();
});
Expand Down Expand Up @@ -320,8 +321,8 @@ IsolateWrap* IsolateWrap::New() {
void IsolateWrap::Dispose() {
LWNODE_CALL_TRACE_ID(ISOWRAP);
LWNODE_CALL_TRACE_GC_START();
// NOTE: check unlock_gc_release(); is needed (and where)
// unlock_gc_release();

unlock_gc_release();

global_handles()->dispose();
RegisteredExtension::unregisterAll();
Expand Down Expand Up @@ -394,6 +395,7 @@ void IsolateWrap::Initialize(const v8::Isolate::CreateParams& params) {
// Do Nothing
LWNODE_CALL_TRACE_GC_START();
// NOTE: Calls when vmInstance() is terminated. This happens before GC runs
LWNODE_DEV_LOG("[OnVMInstanceDelete]");
LWNODE_CALL_TRACE_GC_END();
});

Expand Down