Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Unified Diff: src/global-handles.cc

Issue 3048034: Releasing allocated chunks in Pool's destructor. (Closed)
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/global-handles.cc
diff --git a/src/global-handles.cc b/src/global-handles.cc
index 573669a4572b813c85bc613ebe176389d3da5886..f089b85e1ab75f018f2cba05662e606222c6bef1 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_++;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698