Skip to content

Commit

Permalink
Fix a possible crash with the remove all files dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOneRing committed Dec 21, 2020
1 parent df1c709 commit e53d181
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/8314
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Fix potential crashes with the remove all dialog

We fixed a bug a dialog window belonging to a removed account could still
be visible. User action on that dialog would then cause a crash.

https://github.com/owncloud/client/pull/8314
1 change: 1 addition & 0 deletions src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1223,6 +1223,7 @@ void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction dir, std::functio
}
setSyncPaused(oldPaused);
});
connect(this, &Folder::destroyed, msgBox, &QMessageBox::deleteLater);
msgBox->open();
}

Expand Down
7 changes: 4 additions & 3 deletions src/libsync/syncengine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,10 +732,11 @@ void SyncEngine::slotDiscoveryFinished()
}

QPointer<QObject> guard = new QObject();
auto callback = [this, finish, guard](bool cancel) -> void {
QPointer<QObject> self = this;
auto callback = [this, self, finish, guard](bool cancel) -> void {
// use a guard to ensure its only called once...
if (!guard)
{
// qpointer to self to ensure we still exist
if (!guard || !self) {
return;
}
guard->deleteLater();
Expand Down

0 comments on commit e53d181

Please sign in to comment.