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

Unified Diff: src/interface.cc

Issue 156643002: Fixed space leak in Interface class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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/interface.cc
diff --git a/src/interface.cc b/src/interface.cc
index 603dfe9b8639307e63cd21e4da94effba80fe2a7..c39d50e3582c4ed1c1496ab45748e05d0a36bc0a 100644
--- a/src/interface.cc
+++ b/src/interface.cc
@@ -89,9 +89,10 @@ void Interface::DoAdd(
ZoneHashMap** map = &Chase()->exports_;
ZoneAllocationPolicy allocator(zone);
- if (*map == NULL)
- *map = new ZoneHashMap(Match, ZoneHashMap::kDefaultHashMapCapacity,
- allocator);
+ if (*map == NULL) {
+ *map = new(zone->New(sizeof(ZoneHashMap)))
+ ZoneHashMap(Match, ZoneHashMap::kDefaultHashMapCapacity, allocator);
+ }
ZoneHashMap::Entry* p = (*map)->Lookup(name, hash, !IsFrozen(), allocator);
if (p == NULL) {
« 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