Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
slab_allocator: fix crash in dtor if V8 is dead
Browse files Browse the repository at this point in the history
Don't try to dispose the persistent handles if the VM is already dead, it
triggers an assertion inside V8.
  • Loading branch information
bnoordhuis committed Jun 5, 2012
1 parent 208d171 commit cc0e7ef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/slab_allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ using v8::Object;
using v8::Persistent;
using v8::String;
using v8::Value;
using v8::V8;


namespace node {
Expand All @@ -49,6 +50,7 @@ SlabAllocator::SlabAllocator(unsigned int size) {

SlabAllocator::~SlabAllocator() {
if (!initialized_) return;
if (V8::IsDead()) return;
slab_sym_.Dispose();
slab_sym_.Clear();
slab_.Dispose();
Expand Down

0 comments on commit cc0e7ef

Please sign in to comment.