summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authormread <qt-info@nokia.com>2011-12-08 14:00:46 (GMT)
committermread <qt-info@nokia.com>2011-12-08 15:49:05 (GMT)
commit8ed37d9bba6e2899724d13bd3ba8911c505b1c8c (patch)
tree8251072be895f4b36693547fe05abc1e4ca31326 /src/corelib
parent258bc6752b2896846ce757ffd8f71de16028a27b (diff)
downloadQt-8ed37d9bba6e2899724d13bd3ba8911c505b1c8c.zip
Qt-8ed37d9bba6e2899724d13bd3ba8911c505b1c8c.tar.gz
Qt-8ed37d9bba6e2899724d13bd3ba8911c505b1c8c.tar.bz2
Symbian: improving diagnostics for QWaitCondition
If a QWaitCondition was deleted while it was waiting, it would crash in the wait() function while trying to use its internal mutex. This crash is not particularly obvious in its cause. QWaitCondition can detect this delete-while-waiting case, issue appropriate warnings and avoid a crash in its internal state. In the app crash case where this problem was found, there is a further crash after this one due to an externally deleted mutex. The app is clearly at fault. But at least there's now more debug info about what the app is doing wrong. Task-number: ou1cimx1#946509 partial fix Reviewed-by: Shane Kearns
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/thread/qwaitcondition_symbian.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/corelib/thread/qwaitcondition_symbian.cpp b/src/corelib/thread/qwaitcondition_symbian.cpp
index c6414e8..ed1011c 100644
--- a/src/corelib/thread/qwaitcondition_symbian.cpp
+++ b/src/corelib/thread/qwaitcondition_symbian.cpp
@@ -112,7 +112,10 @@ public:
--wakeups;
}
- mutex.Signal();
+ // if err is KErrGeneral it signals that the RCondVar is closed along with the mutex and that this has been deleted
+ // we must not access any member variables in this case
+ if (err != KErrGeneral)
+ mutex.Signal();
if (err && err != KErrTimedOut)
report_error(err, "QWaitCondition::wait()", "cv wait");