Browse Source

slab_allocator: fix crash in dtor if V8 is dead

Don't try to dispose the persistent handles if the VM is already dead, it
triggers an assertion inside V8.
v0.9.1-release
Ben Noordhuis 13 years ago
parent
commit
cc0e7efb37
  1. 2
      src/slab_allocator.cc

2
src/slab_allocator.cc

@ -37,6 +37,7 @@ using v8::Object;
using v8::Persistent;
using v8::String;
using v8::Value;
using v8::V8;
namespace node {
@ -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();

Loading…
Cancel
Save