diff options
author | Timothy Pearson <[email protected]> | 2012-12-06 18:29:37 -0600 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-12-06 18:29:37 -0600 |
commit | caf80d88243aaa00e8f1baeaa6b7e4c3aca75f63 (patch) | |
tree | 860926c1e01068a8d3b8ea120630a48cf537424b /src/kernel/qapplication.cpp | |
parent | 78125ea2f051107b84fdc0354acdedb7885308ee (diff) | |
download | qt3-caf80d88243aaa00e8f1baeaa6b7e4c3aca75f63.tar.gz qt3-caf80d88243aaa00e8f1baeaa6b7e4c3aca75f63.zip |
Add threading tutorial and fix a couple rare crashes
Diffstat (limited to 'src/kernel/qapplication.cpp')
-rw-r--r-- | src/kernel/qapplication.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/kernel/qapplication.cpp b/src/kernel/qapplication.cpp index a9c9fb8..f3b0119 100644 --- a/src/kernel/qapplication.cpp +++ b/src/kernel/qapplication.cpp @@ -2767,7 +2767,10 @@ bool QApplication::internalNotify( QObject *receiver, QEvent * e) if (!handled) { #if defined(QT_THREAD_SUPPORT) - bool locked = QApplication::qt_mutex->locked(); + bool locked = false; + if (QApplication::qt_mutex) { + locked = QApplication::qt_mutex->locked(); + } if (locked) { QApplication::qt_mutex->unlock(); } @@ -2775,7 +2778,9 @@ bool QApplication::internalNotify( QObject *receiver, QEvent * e) consumed = receiver->event( e ); #if defined(QT_THREAD_SUPPORT) if (locked) { - QApplication::qt_mutex->lock(); + if (QApplication::qt_mutex) { + QApplication::qt_mutex->lock(); + } } #endif } |