Skip to content
This repository
Browse code

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.
  • Loading branch information...
commit cc0e7efb3765ffd22d1394618e3f648cde7dfddc 1 parent 208d171
Ben Noordhuis bnoordhuis authored

Showing 1 changed file with 2 additions and 0 deletions. Show diff stats Hide diff stats

  1. +2 0  src/slab_allocator.cc
2  src/slab_allocator.cc
@@ -37,6 +37,7 @@ using v8::Object;
37 37 using v8::Persistent;
38 38 using v8::String;
39 39 using v8::Value;
  40 +using v8::V8;
40 41
41 42
42 43 namespace node {
@@ -49,6 +50,7 @@ SlabAllocator::SlabAllocator(unsigned int size) {
49 50
50 51 SlabAllocator::~SlabAllocator() {
51 52 if (!initialized_) return;
  53 + if (V8::IsDead()) return;
52 54 slab_sym_.Dispose();
53 55 slab_sym_.Clear();
54 56 slab_.Dispose();

0 comments on commit cc0e7ef

Please sign in to comment.
Something went wrong with that request. Please try again.