Skip to content

Commit 30acc0d

Browse files
committed
fix: revert commeted lock_gc_release
Signed-off-by: Daeyeon Jeong <[email protected]>
1 parent d87a5dc commit 30acc0d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/api/isolate.cc

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,9 @@ IsolateWrap::IsolateWrap() {
283283

284284
threadManager_ = new ThreadManager();
285285

286-
// NOTE: check lock_gc_release(); is needed (and where)
287-
// lock_gc_release();
286+
// The following ensures this instance is retained using PersistentHolder.
287+
lock_gc_release();
288+
288289
Memory::gcRegisterFinalizer(this, [](void* self) {
289290
reinterpret_cast<IsolateWrap*>(self)->~IsolateWrap();
290291
});
@@ -320,8 +321,8 @@ IsolateWrap* IsolateWrap::New() {
320321
void IsolateWrap::Dispose() {
321322
LWNODE_CALL_TRACE_ID(ISOWRAP);
322323
LWNODE_CALL_TRACE_GC_START();
323-
// NOTE: check unlock_gc_release(); is needed (and where)
324-
// unlock_gc_release();
324+
325+
unlock_gc_release();
325326

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

0 commit comments

Comments
 (0)