Fix a crash on if shutting down during propagation
authorJocelyn Turcotte <jturcotte@woboq.com>
Fri, 17 Jun 2016 17:04:24 +0000 (19:04 +0200)
committerJocelyn Turcotte <jturcotte@woboq.com>
Fri, 17 Jun 2016 17:20:52 +0000 (19:20 +0200)
The SyncRunFileLog owned by the Folder must be destroyed after the
SyncEngine since the SyncEngine will abort during destruction, resulting
in all jobs being aborted.

It's possible that this crash only happens with a debug build.

src/gui/folder.cpp

index 0a88c68c9243509bd9c79f61afc9ca7be874afd8..ac50c7f06766642df2c9fcd1e1eec20aa256fa5d 100644 (file)
@@ -121,6 +121,8 @@ Folder::Folder(const FolderDefinition& definition,
 
 Folder::~Folder()
 {
+    // Reset then engine first as it will abort and try to access members of the Folder
+    _engine.reset();
 }
 
 void Folder::checkLocalPath()