Syncengine: Wait for the neon thead to be finished before destroying the Propagator and calling csync_commit

The legacy job might still need the neon session and the propagator.
We need to make sure the thread exits before.

This fixes crash when pausing a sync made with the legacy jobs
(for example when there is network limitation)
This should fix https://github.com/owncloud/enterprise/issues/200
This commit is contained in:
Olivier Goffart 2014-06-18 15:04:55 +02:00
parent 0a953b91f9
commit 0880444e37

View file

@ -663,14 +663,14 @@ void SyncEngine::slotFinished()
void SyncEngine::finalize() void SyncEngine::finalize()
{ {
_thread.quit();
_thread.wait();
csync_commit(_csync_ctx); csync_commit(_csync_ctx);
qDebug() << "CSync run took " << _stopWatch.addLapTime(QLatin1String("Sync Finished")); qDebug() << "CSync run took " << _stopWatch.addLapTime(QLatin1String("Sync Finished"));
_stopWatch.stop(); _stopWatch.stop();
_propagator.reset(0); _propagator.reset(0);
_thread.quit();
_thread.wait();
_syncRunning = false; _syncRunning = false;
emit finished(); emit finished();
} }