From 84e3f04f3c828899f9204830c2e4d7468057f582 Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sun, 15 Sep 2024 15:32:01 -0700 Subject: [PATCH] service/tray: disconnect menu from handle on deletion Fixes loaded being set to true after deleting the menu. --- src/dbus/dbusmenu/dbusmenu.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dbus/dbusmenu/dbusmenu.cpp b/src/dbus/dbusmenu/dbusmenu.cpp index 0d966610..13919faf 100644 --- a/src/dbus/dbusmenu/dbusmenu.cpp +++ b/src/dbus/dbusmenu/dbusmenu.cpp @@ -545,6 +545,9 @@ void DBusMenuHandle::onMenuPathChanged() { qCDebug(logDbusMenu) << "Updating" << this << "with refcount" << this->refcount; if (this->mMenu) { + // Without this, layout updated can be sent after mMenu is set to null, + // leaving loaded = true while mMenu = nullptr. + QObject::disconnect(&this->mMenu->rootItem, nullptr, this, nullptr); this->mMenu->deleteLater(); this->mMenu = nullptr; this->loaded = false;