Fix crash on thread termination

pull/2/head
Timothy Pearson 12 years ago
parent 17ffc1e193
commit 8ff73908ee

@ -3732,7 +3732,7 @@ void QApplication::removePostedEvent( QEvent * event )
void qThreadTerminationHandlerRecursive( QObject* object, QThread* originThread, QThread* destinationThread ) { void qThreadTerminationHandlerRecursive( QObject* object, QThread* originThread, QThread* destinationThread ) {
#ifdef QT_THREAD_SUPPORT #ifdef QT_THREAD_SUPPORT
QThread* objectThread = object->contextThreadObject(); QThread* objectThread = object->contextThreadObject();
if (objectThread != destinationThread) { if (objectThread && (objectThread != destinationThread)) {
QThread::CleanupType cleanupType = objectThread->cleanupType(); QThread::CleanupType cleanupType = objectThread->cleanupType();
if (cleanupType == QThread::CleanupMergeObjects) { if (cleanupType == QThread::CleanupMergeObjects) {
object->moveToThread(destinationThread); object->moveToThread(destinationThread);

Loading…
Cancel
Save