summaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
authorhelanti <ext-jaakko.helanti@nokia.com>2011-11-09 08:21:00 +0200
committerhelanti <ext-jaakko.helanti@nokia.com>2011-11-09 09:21:32 +0200
commit2bed1efe0c129b6ee3de02bde284872fee5603cc (patch)
tree77ab91635c47d272af88c2d74d7bb77a6dcc3dcb /src/corelib
parent345c3f3502832e4850a6d9ea330ddca0c6e9c8bd (diff)
downloadqt4-tools-2bed1efe0c129b6ee3de02bde284872fee5603cc.tar.gz
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
Diffstat (limited to 'src/corelib')
-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 fca2feb937..2d01cda410 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();