summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Edmundson <[email protected]>2017-01-17 22:18:57 +0000
committerDavid Edmundson <[email protected]>2017-01-17 22:18:57 +0000
commita735ac9d61c7886a14426a05a7dc08a78d6b91cf (patch)
treeb227ced4e20977890a1ba75fb05a88a4d6c6085c
parent162543b7eb8918aa0430a74ab2688068262ac711 (diff)
guard against menu being deleted whilst updating
-rw-r--r--libdbusmenuqt/dbusmenuimporter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libdbusmenuqt/dbusmenuimporter.cpp b/libdbusmenuqt/dbusmenuimporter.cpp
index 07f62ac..951ddba 100644
--- a/libdbusmenuqt/dbusmenuimporter.cpp
+++ b/libdbusmenuqt/dbusmenuimporter.cpp
@@ -477,20 +477,20 @@ void DBusMenuImporter::slotAboutToShowDBusCallFinished(QDBusPendingCallWatcher *
watcher->deleteLater();
QMenu *menu = d->menuForId(id);
+ if (!menu) {
+ return;
+ }
QDBusPendingReply<bool> reply = *watcher;
if (reply.isError()) {
qWarning() << "Call to AboutToShow() failed:" << reply.error().message();
- if (menu) {
- menuUpdated(menu);
- }
+ menuUpdated(menu);
return;
}
//Note, this isn't used by Qt's QPT - but we get a LayoutChanged emitted before
//this returns, which equates to the same thing
bool needRefresh = reply.argumentAt<0>();
-
if (needRefresh || menu->actions().isEmpty()) {
d->m_idsRefreshedByAboutToShow << id;
d->refresh(id);