Propagator: change order of destruction
authorOlivier Goffart <ogoffart@woboq.com>
Thu, 16 Mar 2017 13:19:36 +0000 (14:19 +0100)
committerOlivier Goffart <ogoffart@woboq.com>
Thu, 16 Mar 2017 13:24:25 +0000 (14:24 +0100)
The destructor of the PropagateItemJob will access the propagator's
_activeJobList. So the _rootJob needs to be destroyed before it.
Order of destruction is the reverse of the order of the members in
the class. So put it at the end so it can be destroyed first.

(This made TestSyncEngine::testDirDownloadWithError crash sometimes
in the master branch)

src/libsync/owncloudpropagator.h

index 8fd4720c18b0e2e682dbedbca3bb225caa435467..0e7be74d71cabdb3e643ed63bfbecb30f6a463e1 100644 (file)
@@ -257,10 +257,7 @@ public:
 
 class OwncloudPropagator : public QObject {
     Q_OBJECT
-
     PropagateItemJob *createJob(const SyncFileItemPtr& item);
-    QScopedPointer<PropagateDirectory> _rootJob;
-
 public:
     const QString _localDir; // absolute path to the local directory. ends with '/'
     const QString _remoteFolder; // remote folder, ends with '/'
@@ -386,6 +383,7 @@ signals:
 private:
 
     AccountPtr _account;
+    QScopedPointer<PropagateDirectory> _rootJob;
 
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
     // access to signals which are protected in Qt4