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

Unified Diff: Source/wtf/HashTable.h

Issue 1058653004: Destruct all instances of value types in WTF::HashTable. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed heap case Created 5 years, 9 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 | « Source/wtf/HashMapTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/wtf/HashTable.h
diff --git a/Source/wtf/HashTable.h b/Source/wtf/HashTable.h
index 3e50fc968bb9c7781880ac76763a1eb3f4b716b9..8fd6415530aa8fd1cfd0fc5b759a4e4c8590c957 100644
--- a/Source/wtf/HashTable.h
+++ b/Source/wtf/HashTable.h
@@ -1009,10 +1009,11 @@ namespace WTF {
// store. With the default allocator it's enough to call the
// destructor, since we will free the memory explicitly and
// we won't see the memory with the bucket again.
- if (!isEmptyOrDeletedBucket(table[i])) {
- if (Allocator::isGarbageCollected)
+ if (Allocator::isGarbageCollected) {
+ if (!isEmptyOrDeletedBucket(table[i]))
deleteBucket(table[i]);
- else
+ } else {
+ if (!isDeletedBucket(table[i]))
table[i].~ValueType();
}
}
« no previous file with comments | « Source/wtf/HashMapTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698