summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhelanti <ext-jaakko.helanti@nokia.com>2011-11-09 06:21:00 (GMT)
committerhelanti <ext-jaakko.helanti@nokia.com>2011-11-09 07:21:32 (GMT)
commit2bed1efe0c129b6ee3de02bde284872fee5603cc (patch)
tree77ab91635c47d272af88c2d74d7bb77a6dcc3dcb
parent345c3f3502832e4850a6d9ea330ddca0c6e9c8bd (diff)
downloadQt-2bed1efe0c129b6ee3de02bde284872fee5603cc.zip
Qt-2bed1efe0c129b6ee3de02bde284872fee5603cc.tar.gz
Qt-2bed1efe0c129b6ee3de02bde284872fee5603cc.tar.bz2
Create cleanup stack in idleDetectorThread
This is to fix a crash problem in idleDetectorThread. idleDetectorThread implementation may use cleanup stack. The culprit is QSysInfo::symbianVersion, which is called in QMutex implementation. The first call of QSysInfo::symbianVersion uses functions with cleanup stack usage. Later calls use cached version info and do not need cleanup stack. Without this fix, if idleDetectorThread starts before version information is cached, a crash happens. Reviewed-by: mread
-rw-r--r--src/corelib/kernel/qeventdispatcher_symbian.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp
index fca2feb..2d01cda 100644
--- a/src/corelib/kernel/qeventdispatcher_symbian.cpp
+++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp
@@ -846,10 +846,15 @@ private:
void IdleLoop()
{
+ // Create cleanup stack.
+ // Mutex handling may contain cleanupstack usage.
+ CTrapCleanup *cleanup = CTrapCleanup::New();
+ q_check_ptr(cleanup);
while (!m_stop) {
m_kick.acquire();
m_state = STATE_RUN;
}
+ delete cleanup;
}
static void StopIdleDetectorThread();