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

Unified Diff: ios/chrome/browser/snapshots/snapshot_cache.mm

Issue 1687453002: Fixed leak on LRU snapshot cache implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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: ios/chrome/browser/snapshots/snapshot_cache.mm
diff --git a/ios/chrome/browser/snapshots/snapshot_cache.mm b/ios/chrome/browser/snapshots/snapshot_cache.mm
index b76ba6ec4889a46a04b4918c50947aa44e51b81c..d8151e2f790167b2bd466186ec27f7fe05f38c59 100644
--- a/ios/chrome/browser/snapshots/snapshot_cache.mm
+++ b/ios/chrome/browser/snapshots/snapshot_cache.mm
@@ -390,7 +390,7 @@ void ConvertAndSaveGreyImage(
DCHECK(!IsIPadIdiom());
DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI);
NSMutableDictionary* dictionary =
sdefresne 2016/02/09 16:17:07 nit: the recommended pattern in Chromium is to use
jbbegue (google) 2016/02/10 15:10:22 Done.
- [[NSMutableDictionary alloc] initWithCapacity:2];
+ [[[NSMutableDictionary alloc] initWithCapacity:2] autorelease];
for (NSString* sessionID in pinnedIDs_) {
UIImage* image = nil;
if (lruCache_)
@@ -405,7 +405,7 @@ void ConvertAndSaveGreyImage(
for (NSString* sessionID in pinnedIDs_)
[lruCache_ setObject:dictionary[sessionID] forKey:sessionID];
} else {
- imageDictionary_.reset(dictionary);
+ imageDictionary_.reset([dictionary retain]);
}
}
« 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