mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
Do not dereference the _engine member variable without check.
This can cause the crash because the _engine member is deleted in the sync finished slot. The solution is to store the stopWatch object before the engine is destroyed. Fixes bug #1675
This commit is contained in:
parent
82ab5fdcb9
commit
aee7515d42
2 changed files with 6 additions and 2 deletions
|
@ -298,7 +298,8 @@ void Folder::bubbleUpSyncResult()
|
|||
|
||||
SyncRunFileLog syncFileLog;
|
||||
|
||||
syncFileLog.start(path(), _engine->stopWatch() );
|
||||
syncFileLog.start(path(), _stopWatch );
|
||||
_stopWatch.reset();
|
||||
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
|
@ -626,6 +627,7 @@ void Folder::slotSyncFinished()
|
|||
qDebug() << "-> CSync Finished slot with error " << _csyncError << "warn count" << _syncResult.warnCount();
|
||||
|
||||
bubbleUpSyncResult();
|
||||
_stopWatch = _engine->stopWatch();
|
||||
|
||||
_engine.reset(0);
|
||||
// _watcher->setEventsEnabledDelayed(2000);
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
#include "mirall/progressdispatcher.h"
|
||||
#include "mirall/syncjournaldb.h"
|
||||
#include "mirall/clientproxy.h"
|
||||
#include "mirall/utility.h"
|
||||
|
||||
#include <csync.h>
|
||||
|
||||
|
@ -186,7 +187,6 @@ private slots:
|
|||
private:
|
||||
bool init();
|
||||
|
||||
|
||||
void setIgnoredFiles();
|
||||
|
||||
void bubbleUpSyncResult();
|
||||
|
@ -217,6 +217,8 @@ private:
|
|||
|
||||
ClientProxy _clientProxy;
|
||||
|
||||
Utility::StopWatch _stopWatch;
|
||||
|
||||
CSYNC *_csync_ctx;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue