From 2bed1efe0c129b6ee3de02bde284872fee5603cc Mon Sep 17 00:00:00 2001 From: helanti Date: Wed, 9 Nov 2011 08:21:00 +0200 Subject: 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 --- src/corelib/kernel/qeventdispatcher_symbian.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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(); -- cgit v0.12