From 49fd95009bc3df7f2da46524245c51dd17ea1907 Mon Sep 17 00:00:00 2001 From: mread Date: Wed, 15 Jun 2011 14:18:08 +0100 Subject: QTBUG-19883 Adding top level TRAP for QThreads on Symbian The native Symbian implementation of QThread in Qt4.8 does not have a top level TRAP, whereas it did in pthreads based implementation in Qt4.7. This causes an incompatibility in the form of a EUSER-CBASE:66 panic for code that attempts to use the cleanup stack without a TRAP of its own. This adds a top level TRAP and std::exception handler to match it and prints out warning information if they ever trigger to provide some diagnostic information which would otherwise be lost. Task-number: QTBUG-19883 Reviewed-by: Laszlo Agocs --- src/corelib/thread/qthread_symbian.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/corelib/thread') diff --git a/src/corelib/thread/qthread_symbian.cpp b/src/corelib/thread/qthread_symbian.cpp index c515ae6d17..46339a69eb 100644 --- a/src/corelib/thread/qthread_symbian.cpp +++ b/src/corelib/thread/qthread_symbian.cpp @@ -335,7 +335,15 @@ void *QThreadPrivate::start(void *arg) createEventDispatcher(data); emit thr->started(); - thr->run(); + TRAPD(err, { + try { + thr->run(); + } catch (const std::exception& ex) { + qWarning("QThreadPrivate::start: Thread exited on exception %s", ex.what()); + } + }); + if (err) + qWarning("QThreadPrivate::start: Thread exited on leave %d", err); QThreadPrivate::finish(arg); -- cgit v1.2.3