forked from quickshell/quickshell
service/tray: disconnect menu from handle on deletion
Fixes loaded being set to true after deleting the menu.
This commit is contained in:
parent
bdc9fe958b
commit
84e3f04f3c
1 changed files with 3 additions and 0 deletions
|
@ -545,6 +545,9 @@ void DBusMenuHandle::onMenuPathChanged() {
|
||||||
qCDebug(logDbusMenu) << "Updating" << this << "with refcount" << this->refcount;
|
qCDebug(logDbusMenu) << "Updating" << this << "with refcount" << this->refcount;
|
||||||
|
|
||||||
if (this->mMenu) {
|
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->deleteLater();
|
||||||
this->mMenu = nullptr;
|
this->mMenu = nullptr;
|
||||||
this->loaded = false;
|
this->loaded = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue