From e7fe50bd3d5a2a1f8427878086ff94deb31091bb Mon Sep 17 00:00:00 2001 From: Simeon Bird Date: Sun, 13 Jan 2013 13:49:21 -0500 Subject: [PATCH] A crash occurs if updateItemStates runs between the UpdateItemStatesThread finishing and the finished() signal being delivered. In this case, a new thread was not created, because the old thread still existed. However, pendingItemStatesUpdate was not set, because the thread was not running. Instead, the old thread was restarted. This meant that the finished() signal from the first run could be delivered while the thread was running for a second time, causing the thread to be deleted while still running and thus a crash. Solution: set pendingItemStatesUpdate if the thread is non-null, even if it is not running, knowing that slotThreadFinished has not yet run, and will call updateItemStates itself. BUG: 302264 FIXED-IN: 4.10 REVIEW: 107656 --- src/views/versioncontrol/versioncontrolobserver.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/versioncontrol/versioncontrolobserver.cpp b/src/views/versioncontrol/versioncontrolobserver.cpp index 42e00de42..64bc26867 100644 --- a/src/views/versioncontrol/versioncontrolobserver.cpp +++ b/src/views/versioncontrol/versioncontrolobserver.cpp @@ -245,7 +245,7 @@ void VersionControlObserver::updateItemStates() connect(m_updateItemStatesThread, SIGNAL(finished()), m_updateItemStatesThread, SLOT(deleteLater())); } - if (m_updateItemStatesThread->isRunning()) { + else { // An update is currently ongoing. Wait until the thread has finished // the update (see slotThreadFinished()). m_pendingItemStatesUpdate = true; -- 2.47.3