Browse Source

slab_allocator: fix leak of Persistent handles

v0.9.1-release
Shigeki Ohtsu 13 years ago
committed by Ben Noordhuis
parent
commit
208d1715a7
  1. 6
      src/slab_allocator.cc

6
src/slab_allocator.cc

@ -49,10 +49,10 @@ SlabAllocator::SlabAllocator(unsigned int size) {
SlabAllocator::~SlabAllocator() {
if (!initialized_) return;
slab_sym_.Clear();
slab_sym_.Dispose();
slab_.Clear();
slab_sym_.Clear();
slab_.Dispose();
slab_.Clear();
}
@ -92,8 +92,8 @@ char* SlabAllocator::Allocate(Handle<Object> obj, unsigned int size) {
}
if (slab_.IsEmpty() || offset_ + size > size_) {
slab_.Clear();
slab_.Dispose();
slab_.Clear();
slab_ = Persistent<Object>::New(NewSlab(size_));
offset_ = 0;
last_ptr_ = NULL;

Loading…
Cancel
Save