[Pkg-owncloud-commits] [owncloud-client] 34/121: SyncEngine: make abort and closing more robust

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu Jul 28 15:31:54 UTC 2016


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 92309013dae728b66c597697de7572b6d8e50f1a
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Wed Jun 15 17:01:00 2016 +0200

    SyncEngine: make abort and closing more robust
    
    We first need to set the abort flag to csync and then aborting the discovery
    job, otherwise, the discovery thread could start a new job in the mean time.
    
    We also need to make sure that the thread has existed before we destroy the
    exclude list.
---
 src/libsync/syncengine.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp
index 36fefc0..d71eba8 100644
--- a/src/libsync/syncengine.cpp
+++ b/src/libsync/syncengine.cpp
@@ -101,10 +101,10 @@ SyncEngine::SyncEngine(AccountPtr account, const QString& localPath,
 SyncEngine::~SyncEngine()
 {
     abort();
-    _excludedFiles.reset();
-    csync_destroy(_csync_ctx);
     _thread.quit();
     _thread.wait();
+    _excludedFiles.reset();
+    csync_destroy(_csync_ctx);
 }
 
 //Convert an error code from csync to a user readable string.
@@ -1379,13 +1379,13 @@ AccountPtr SyncEngine::account() const
 
 void SyncEngine::abort()
 {
+    // Sets a flag for the update phase
+    csync_request_abort(_csync_ctx);
     qDebug() << Q_FUNC_INFO << _discoveryMainThread;
     // Aborts the discovery phase job
     if (_discoveryMainThread) {
         _discoveryMainThread->abort();
     }
-    // Sets a flag for the update phase
-    csync_request_abort(_csync_ctx);
     // For the propagator
     if(_propagator) {
         _propagator->abort();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list