From 1f9168d3839b2081572368b786c263a04955337c Mon Sep 17 00:00:00 2001 From: Murray Read Date: Mon, 18 Jun 2012 16:43:19 +0100 Subject: Removing potential crashes from out-of-thread cleanup on Symbian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There have been some crashes seen on Symbian when its adoptedThreadMonitor attempts to clean up objects created in other, now dead, threads. Some of these objects simply can't be cleaned up properly outside of their original thread, so the thread has to be checked when they are cleaned up, and cleanup skipped in the wrong thread. For pthread created threads, we also have the ability to insert cleanup code during thread shutdown. This was used in the 4.7 implementation of QThread on Symbian, and is a better solution for pthread based adopted threads as it gives in-thread cleanup. So the appropriate pthread code is also used with changes to adoptedThreadMonitor so that it can run along side the pthread cleanup code. Change-Id: Iad8207879b1ece62e5cce85f26a616166aa22486 Reviewed-by: Juha Kukkonen Reviewed-by: Pasi Pentikäinen --- src/corelib/kernel/qeventdispatcher_symbian.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib/kernel') diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index a4c113b407..c26166b773 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -1041,7 +1041,8 @@ void QEventDispatcherSymbian::closingDown() delete m_completeDeferredAOs; delete m_wakeUpAO; - if (m_activeScheduler) { + // only delete the active scheduler in its own thread + if (m_activeScheduler && QThread::currentThread() == thread()) { delete m_activeScheduler; } } -- cgit v1.2.1