mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 13:35:58 +03:00
Fix a possible crash with the remove all files dialog
This commit is contained in:
parent
da3ff631ef
commit
09cc988026
2 changed files with 5 additions and 3 deletions
|
@ -1260,6 +1260,7 @@ void Folder::slotAboutToRemoveAllFiles(SyncFileItem::Direction dir, std::functio
|
|||
}
|
||||
setSyncPaused(oldPaused);
|
||||
});
|
||||
connect(this, &Folder::destroyed, msgBox, &QMessageBox::deleteLater);
|
||||
msgBox->open();
|
||||
}
|
||||
|
||||
|
|
|
@ -737,10 +737,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();
|
||||
|
|
Loading…
Reference in a new issue