Folder::wipe: We need to shut the socket API down before removing the DB
authorOlivier Goffart <ogoffart@woboq.com>
Fri, 23 Oct 2015 15:24:45 +0000 (17:24 +0200)
committerOlivier Goffart <ogoffart@woboq.com>
Fri, 23 Oct 2015 15:43:01 +0000 (17:43 +0200)
Because the DB stays open and locked.

Should fix #3824

src/gui/folder.cpp

index 53509edc85907ff31db68d4d3af22087bac98da8..5d3db6afe67db25a28e979c67795e7d18ccab955 100644 (file)
@@ -28,6 +28,7 @@
 #include "clientproxy.h"
 #include "syncengine.h"
 #include "syncrunfilelog.h"
+#include "socketapi.h"
 #include "theme.h"
 #include "filesystem.h"
 #include "excludedfiles.h"
@@ -771,6 +772,8 @@ void Folder::wipe()
     // Delete files that have been partially downloaded.
     slotDiscardDownloadProgress();
 
+    //Unregister the socket API so it does not keep the .sync_journal file open
+    FolderMan::instance()->socketApi()->slotUnregisterPath(alias());
     _journal.close(); // close the sync journal
 
     QFile file(stateDbFile);
@@ -789,6 +792,8 @@ void Folder::wipe()
     QFile::remove( stateDbFile + "-shm" );
     QFile::remove( stateDbFile + "-wal" );
     QFile::remove( stateDbFile + "-journal" );
+
+    FolderMan::instance()->socketApi()->slotRegisterPath(alias());
 }
 
 bool Folder::setIgnoredFiles()