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

Unified Diff: sync/syncable/directory.cc

Issue 283143002: sync: Improve handling of bad UniquePos (retry) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | « sync/sync_tests.gypi ('k') | sync/syncable/directory_backing_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/syncable/directory.cc
diff --git a/sync/syncable/directory.cc b/sync/syncable/directory.cc
index cebb2d4fd8401cf0410de0bf543e9c89dc55f148..e523bcdf290cec0d608792bb761b257e632d2a9e 100644
--- a/sync/syncable/directory.cc
+++ b/sync/syncable/directory.cc
@@ -167,6 +167,11 @@ DirOpenResult Directory::OpenImpl(
// Temporary indices before kernel_ initialized in case Load fails. We 0(1)
// swap these later.
Directory::MetahandlesMap tmp_handles_map;
+
+ // Avoids mem leaks on failure. Harmlessly deletes the empty hash map after
+ // the swap in the success case.
+ STLValueDeleter<Directory::MetahandlesMap> deleter(&tmp_handles_map);
+
JournalIndex delete_journals;
DirOpenResult result =
« no previous file with comments | « sync/sync_tests.gypi ('k') | sync/syncable/directory_backing_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698