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]); |
} |
} |