From: antonm@chromium.org Date: Wed, 28 Jul 2010 12:34:41 +0000 (+0000) Subject: Releasing allocated chunks in Pool's destructor. X-Git-Tag: upstream/4.7.83~21437 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10b847eb555803f2f0e71aaf7580fb5192500701;p=platform%2Fupstream%2Fv8.git Releasing allocated chunks in Pool's destructor. That should make it not leak if v8 wasn't intialized at all. Review URL: http://codereview.chromium.org/3048034 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@5142 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- diff --git a/src/global-handles.cc b/src/global-handles.cc index 573669a..f089b85 100644 --- a/src/global-handles.cc +++ b/src/global-handles.cc @@ -226,6 +226,12 @@ class GlobalHandles::Pool BASE_EMBEDDED { limit_ = current_->nodes + kNodesPerChunk; } + ~Pool() { + if (current_ != NULL) { + Release(); + } + } + Node* Allocate() { if (next_ < limit_) { return next_++;