summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkinaba@google.com <kinaba@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-30 13:26:54 +0000
committerkinaba@google.com <kinaba@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-30 13:26:54 +0000
commit1b463bdf07e07b9607618a13a4dcd469147daff6 (patch)
tree33f41515f7422d2accb0b468d33ba3609c43fbe9
parentd825cf73f836eb4527aa608eb7b37976c5765ffe (diff)
downloadchromium_src-1b463bdf07e07b9607618a13a4dcd469147daff6.zip
chromium_src-1b463bdf07e07b9607618a13a4dcd469147daff6.tar.gz
chromium_src-1b463bdf07e07b9607618a13a4dcd469147daff6.tar.bz2
Fix memory leak of base/i18n/time_formatter.cc
This patch fixes the leak exposed by the newly added unittests in http://src.chromium.org/viewvc/chrome?view=rev&revision=87229. BUG=None TEST=base_unittests: TimeFormattingTest.TimeFormatTimeOfDayDefault12h Review URL: http://codereview.chromium.org/7082038 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@87234 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/i18n/time_formatting.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/base/i18n/time_formatting.cc b/base/i18n/time_formatting.cc
index 95d481e..419e8db 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 =