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

Unified Diff: chrome/browser/translate/translate_prefs.cc

Issue 23606034: Fix a memory leak in translate_prefs.cc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 3 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: chrome/browser/translate/translate_prefs.cc
===================================================================
--- chrome/browser/translate/translate_prefs.cc (revision 222257)
+++ chrome/browser/translate/translate_prefs.cc (working copy)
@@ -356,16 +356,16 @@
// Create the new preference kPrefTranslateBlockedLanguages.
{
- ListValue* blocked_languages_list = new ListValue();
+ ListValue blocked_languages_list;
for (std::vector<std::string>::const_iterator it =
blocked_languages.begin();
it != blocked_languages.end(); ++it) {
- blocked_languages_list->Append(new StringValue(*it));
+ blocked_languages_list.Append(new StringValue(*it));
}
ListPrefUpdate update(user_prefs, kPrefTranslateBlockedLanguages);
ListValue* list = update.Get();
DCHECK(list != NULL);
- list->Swap(blocked_languages_list);
+ list->Swap(&blocked_languages_list);
}
// Update kAcceptLanguages
« 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