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
This commit is contained in:
antonm@chromium.org 2010-07-28 12:34:41 +00:00
parent 9d6fd08276
commit 10b847eb55

View File

@ -226,6 +226,12 @@ class GlobalHandles::Pool BASE_EMBEDDED {
limit_ = current_->nodes + kNodesPerChunk; limit_ = current_->nodes + kNodesPerChunk;
} }
~Pool() {
if (current_ != NULL) {
Release();
}
}
Node* Allocate() { Node* Allocate() {
if (next_ < limit_) { if (next_ < limit_) {
return next_++; return next_++;