We need to call csync_commit in every error cases

Else there will still be outdated tree in the memory and the further sync
will be confused

Relates to #1710
This commit is contained in:
Olivier Goffart 2014-05-15 11:17:13 +02:00
parent 9f6e9f8e1b
commit 90ee274744

View file

@ -553,6 +553,7 @@ void SyncEngine::slotUpdateFinished(int updateResult)
if (!_journal->isConnected()) {
qDebug() << "Bailing out, DB failure";
emit csyncError(tr("Cannot open the sync journal"));
csync_commit(_csync_ctx);
emit finished();
_syncMutex.unlock();
_thread.quit();
@ -569,6 +570,7 @@ void SyncEngine::slotUpdateFinished(int updateResult)
emit aboutToRemoveAllFiles(_syncedItems.first()._direction, &cancel);
if (cancel) {
qDebug() << Q_FUNC_INFO << "Abort sync";
csync_commit(_csync_ctx);
emit finished();
_syncMutex.unlock();
_thread.quit();