Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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
@bnoordhuis bnoordhuis authored
Showing with 2 additions and 0 deletions.
  1. +2 −0  src/slab_allocator.cc
View
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();
Please sign in to comment.
Something went wrong with that request. Please try again.