From 208d1715a788562dbdb8f7eae17ddfb254690e5b Mon Sep 17 00:00:00 2001 From: Shigeki Ohtsu Date: Tue, 5 Jun 2012 19:24:15 +0900 Subject: [PATCH] slab_allocator: fix leak of Persistent handles --- src/slab_allocator.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/slab_allocator.cc b/src/slab_allocator.cc index 45daf621a9..0e643f8c9f 100644 --- a/src/slab_allocator.cc +++ b/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 obj, unsigned int size) { } if (slab_.IsEmpty() || offset_ + size > size_) { - slab_.Clear(); slab_.Dispose(); + slab_.Clear(); slab_ = Persistent::New(NewSlab(size_)); offset_ = 0; last_ptr_ = NULL;