summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShigeki Ohtsu <ohtsu@iij.ad.jp>2012-06-05 19:24:15 +0900
committerBen Noordhuis <info@bnoordhuis.nl>2012-06-05 15:45:08 +0200
commit208d1715a788562dbdb8f7eae17ddfb254690e5b (patch)
tree6648d1a4d7c77dbec2df5c3811db60bb2002d539 /src
parentb9e40fbaacc60de562481b764b0e78bf021f7cfa (diff)
downloadnode-new-208d1715a788562dbdb8f7eae17ddfb254690e5b.tar.gz
slab_allocator: fix leak of Persistent handles
Diffstat (limited to 'src')
-rw-r--r--src/slab_allocator.cc6
1 files 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<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;