Discovery: make sure finished is not called twice, even in case of errors
authorOlivier Goffart <ogoffart@woboq.com>
Tue, 16 Oct 2018 14:18:39 +0000 (16:18 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:10 +0000 (10:58 +0100)
src/libsync/discovery.cpp

index 0a50488ef24c38d25eaf5695318eda74bcf151c3..4bd7dce69320815ba7405b7bf32857724f36b629 100644 (file)
@@ -1182,6 +1182,7 @@ int ProcessDirectoryJob::processSubJobs(int nbJobs)
 void ProcessDirectoryJob::dbError()
 {
     _discoveryData->fatalError(tr("Error while reading the database"));
+    _pendingAsyncJobs = -1; // We're finished, we don't want to emit finished again
     emit finished();
 }
 }