summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2012-06-05 15:58:55 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2012-06-05 16:27:57 +0200
commitcc0e7efb3765ffd22d1394618e3f648cde7dfddc (patch)
tree40f8d3cdf8e4b555c4fcdd7ecadf89c7c2494724
parent208d1715a788562dbdb8f7eae17ddfb254690e5b (diff)
downloadnode-cc0e7efb3765ffd22d1394618e3f648cde7dfddc.tar.gz
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.
-rw-r--r--src/slab_allocator.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/slab_allocator.cc b/src/slab_allocator.cc
index 0e643f8c9..e0d7b1313 100644
--- a/src/slab_allocator.cc
+++ b/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();