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 From 120199e1ba102fb294e580b2905e370c15ebf2d0 Mon Sep 17 00:00:00 2001 From: Miikka Heikkinen Date: Thu, 10 Nov 2011 13:50:11 +0200 Subject: Fix memory leak in QCursorData QCursorData::cleanup() was never called on Symbian. Task-number: QTBUG-22643 Reviewed-by: Murray Read --- src/gui/kernel/qapplication_s60.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 46b16cb..fe239f5 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -65,6 +65,7 @@ #ifdef QT_GRAPHICSSYSTEM_RUNTIME #include "private/qgraphicssystem_runtime_p.h" #endif +#include "private/qcursor_p.h" #include "apgwgnam.h" // For CApaWindowGroupName #include // For CMdaAudioToneUtility @@ -2098,6 +2099,10 @@ void qt_cleanup() // Call EndFullScreen() to prevent confusing the system effect state machine. qt_endFullScreenEffect(); +#ifndef QT_NO_CURSOR + QCursorData::cleanup(); +#endif + if (S60->qtOwnsS60Environment) { // Restore the S60 framework trap handler. See qt_init(). User::SetTrapHandler(S60->s60InstalledTrapHandler); -- cgit v0.12