summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormread <qt-info@nokia.com>2011-08-05 12:35:39 (GMT)
committermread <qt-info@nokia.com>2011-08-05 12:39:10 (GMT)
commit99cd47972d4d231f787daf0f647397df7194af68 (patch)
treec5744c2a217c0e01c1f2edca62fe66655e23b973
parentb997613ebea79f28631bef3e6dd6dde8ebd65e06 (diff)
downloadQt-99cd47972d4d231f787daf0f647397df7194af68.zip
Qt-99cd47972d4d231f787daf0f647397df7194af68.tar.gz
Qt-99cd47972d4d231f787daf0f647397df7194af68.tar.bz2
Fixed Symbian memory leak in utcToLocal(QDate &, QTime &)
RTz::GetTimeZoneIdL() returns a CTzId object which the client has to own. But in utcToLocal(QDate &, QTime &) it was being used anonymously and forgotten. Task-number: QTBUG-20765 Reviewed-by: Shane Kearns
-rw-r--r--src/corelib/tools/qdatetime.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index a6fee43..d915989 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -4040,8 +4040,11 @@ static QDateTimePrivate::Spec utcToLocal(QDate &date, QTime &time)
RTz tz;
User::LeaveIfError(tz.Connect());
CleanupClosePushL(tz);
- res.tm_isdst = tz.IsDaylightSavingOnL(*tz.GetTimeZoneIdL(),utcTTime);
+ CTzId *tzId = tz.GetTimeZoneIdL();
+ CleanupStack::PushL(tzId);
+ res.tm_isdst = tz.IsDaylightSavingOnL(*tzId,utcTTime);
User::LeaveIfError(tz.ConvertToLocalTime(utcTTime));
+ CleanupStack::PopAndDestroy(tzId);
CleanupStack::PopAndDestroy(&tz));
if (KErrNone == err) {
TDateTime localDateTime = utcTTime.DateTime();