From: Kevin Ottens Date: Wed, 14 Oct 2020 16:35:12 +0000 (+0200) Subject: Emit last to avoid use after delete crash X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~22^2~103^2~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=e502e719267370f2920d2eb7efc14d34388ff850;p=nextcloud-desktop.git Emit last to avoid use after delete crash It turns out the shareDeleted() signal is connected to a function cleaning up the ShareLinkWidget holding the last shared pointer to the Share object. Since we use member variables for calling updateFolder() this would lead to using deleted objects. Just swap the call and the signal to have everything back in order. Signed-off-by: Kevin Ottens --- diff --git a/src/gui/sharemanager.cpp b/src/gui/sharemanager.cpp index 2b8fbd4a9..87df91350 100644 --- a/src/gui/sharemanager.cpp +++ b/src/gui/sharemanager.cpp @@ -133,9 +133,8 @@ void Share::deleteShare() void Share::slotDeleted() { - emit shareDeleted(); - updateFolder(_account, _path); + emit shareDeleted(); } void Share::slotOcsError(int statusCode, const QString &message)