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

Unified Diff: base/i18n/time_formatting.cc

Issue 7082038: Fix memory leak of base/i18n/time_formatter.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/time_formatting.cc
diff --git a/base/i18n/time_formatting.cc b/base/i18n/time_formatting.cc
index 95d481e7190ea55f01fd6507e34163dec24f3db6..419e8db0500631b2c7d1256d5a09f3a9918d0d76 100644
--- a/base/i18n/time_formatting.cc
+++ b/base/i18n/time_formatting.cc
@@ -73,8 +73,8 @@ string16 TimeFormatTimeOfDayWithHourClockType(const Time& time,
// use (some locales use '.' instead of ':'), and where to put the am/pm
// marker.
UErrorCode status = U_ZERO_ERROR;
- icu::DateTimePatternGenerator *generator =
- icu::DateTimePatternGenerator::createInstance(status);
+ scoped_ptr<icu::DateTimePatternGenerator> generator(
+ icu::DateTimePatternGenerator::createInstance(status));
CHECK(U_SUCCESS(status));
const char* base_pattern = (type == k12HourClock ? "ahm" : "Hm");
icu::UnicodeString generated_pattern =
« 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