diff options
author | Murray Read <ext-murray.2.read@nokia.com> | 2012-02-06 15:33:30 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-08 00:52:00 (GMT) |
commit | f343fc7c0844fc33886f3e25d49e043062c06e7a (patch) | |
tree | 454ed6aeb7d28e662822b18eaf606e9517cb6622 /src/corelib/tools | |
parent | f41135a9f83d17b319ad050dfacc7a8e88598151 (diff) | |
download | Qt-f343fc7c0844fc33886f3e25d49e043062c06e7a.zip Qt-f343fc7c0844fc33886f3e25d49e043062c06e7a.tar.gz Qt-f343fc7c0844fc33886f3e25d49e043062c06e7a.tar.bz2 |
Changes in Symbian CleanupStack use to allow dodgy app start
Some important apps were found to invoke Qt code using the Symbian
CleanupStack during static data initialization. This is not legal Qt
code, but due to the importance of maintaining compatability with these
apps, Qt has been modified to avoid the problem.
In one case by removing unnessary use of CleanupStack. In the other
by creating a temporary CleanupStack.
Task-number: ou1cimx1#960665
Change-Id: Iff631a638dceec10aa38add88ba93a63a831a574
Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r-- | src/corelib/tools/qdatetime.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 4f90f83..17e5371 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -4038,6 +4038,7 @@ static QDateTimePrivate::Spec utcToLocal(QDate &date, QTime &time) tm res; if(err == KErrNone) { TTime utcTTime = epochTTime + tTimeIntervalSecsSince1Jan1970UTC; + CTrapCleanup *cleanup = CTrapCleanup::New(); // needed to avoid crashes in apps that previously were able to use this function in static data initialization TRAP(err, RTz tz; User::LeaveIfError(tz.Connect()); @@ -4048,6 +4049,7 @@ static QDateTimePrivate::Spec utcToLocal(QDate &date, QTime &time) User::LeaveIfError(tz.ConvertToLocalTime(utcTTime)); CleanupStack::PopAndDestroy(tzId); CleanupStack::PopAndDestroy(&tz)); + delete cleanup; if (KErrNone == err) { TDateTime localDateTime = utcTTime.DateTime(); res.tm_sec = localDateTime.Second(); |