From 8ccf7283a1a90d125a774027c6bc3028ab0d29f7 Mon Sep 17 00:00:00 2001 From: Murray Read Date: Wed, 13 Jun 2012 13:06:53 +0100 Subject: Avoid crash cancelling timer in wrong thread on terminate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the Symbian timer active object detects that it is cancelled in the wrong thread, it was issuing a qFatal. But that was an overreaction, as the situation is not necessarily fatal if the thread in which the timer lives is about to die. For example if QThread::terminate is used outside of the thread targeted. Instead a debug message should be issued so that if there is a crash, the programmer should get information as to why. The debug message, in this case, is issued with RDebug::Print to avoid the use of Qt's message output which itself was crashing in partially finished thread situations. Task-number: ou1cimx1#1006699 Change-Id: I7d192eb27ba85ba2ef4f80fec3d8479f0df8f90c Reviewed-by: Juha Kukkonen Reviewed-by: Pasi Pentikäinen --- src/corelib/kernel/qeventdispatcher_symbian.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/kernel/qeventdispatcher_symbian.cpp b/src/corelib/kernel/qeventdispatcher_symbian.cpp index f209b7a..a4c113b 100644 --- a/src/corelib/kernel/qeventdispatcher_symbian.cpp +++ b/src/corelib/kernel/qeventdispatcher_symbian.cpp @@ -281,7 +281,7 @@ void QTimerActiveObject::DoCancel() // Cancel requires a signal to continue, we're in the wrong thread to use the RTimer if (m_threadData->symbian_thread_handle.ExitType() == EExitPending) { // owner thread is still running, it will receive a stray event if the timer fires now. - qFatal("QTimerActiveObject cancelled from wrong thread"); + RDebug::Print(_L("QTimerActiveObject cancelled from wrong thread, owner thread will probably panic with stray signal")); } TRequestStatus *status = &iStatus; User::RequestComplete(status, KErrCancel); -- cgit v0.12