Skip to content

Commit dfd924f

Browse files
Murray ReadPasi Pentikäinen
Murray Read
authored and
Pasi Pentikäinen
committed
Avoid crash cancelling timer in wrong thread on terminate
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 <[email protected]> Reviewed-by: Pasi Pentikäinen <[email protected]> (cherry picked from commit 8ccf728)
1 parent adcf76f commit dfd924f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/corelib/kernel/qeventdispatcher_symbian.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ void QTimerActiveObject::DoCancel()
281281
// Cancel requires a signal to continue, we're in the wrong thread to use the RTimer
282282
if (m_threadData->symbian_thread_handle.ExitType() == EExitPending) {
283283
// owner thread is still running, it will receive a stray event if the timer fires now.
284-
qFatal("QTimerActiveObject cancelled from wrong thread");
284+
RDebug::Print(_L("QTimerActiveObject cancelled from wrong thread, owner thread will probably panic with stray signal"));
285285
}
286286
TRequestStatus *status = &iStatus;
287287
User::RequestComplete(status, KErrCancel);

0 commit comments

Comments
 (0)