Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
slab_allocator: fix leak of Persistent handles
Browse files Browse the repository at this point in the history
  • Loading branch information
Shigeki Ohtsu authored and bnoordhuis committed Jun 5, 2012
1 parent b9e40fb commit 208d171
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/slab_allocator.cc
Expand Up @@ -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();
}


Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 208d171

Please sign in to comment.