From 7f9762be5368ca33b84e7b2b3e23a626d432436d Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Tue, 17 Sep 2024 23:44:41 -0700 Subject: [PATCH] service/pipewire: disconnect link tracker from registry on node destroy Caused duplicate entries to be created due to double connection, which then caused a crash. --- src/services/pipewire/qml.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/services/pipewire/qml.cpp b/src/services/pipewire/qml.cpp index b40de687..7092eb4a 100644 --- a/src/services/pipewire/qml.cpp +++ b/src/services/pipewire/qml.cpp @@ -220,6 +220,8 @@ PwNodeLinkTracker::linkGroupAt(QQmlListProperty* property, qsi void PwNodeLinkTracker::onNodeDestroyed() { this->mNode = nullptr; + QObject::disconnect(&PwConnection::instance()->registry, nullptr, this, nullptr); + this->updateLinks(); emit this->nodeChanged(); } @@ -350,7 +352,6 @@ PwLinkIface* PwLinkIface::instance(PwLink* link) { PwLinkGroupIface::PwLinkGroupIface(PwLinkGroup* group): QObject(group), mGroup(group) { QObject::connect(group, &PwLinkGroup::stateChanged, this, &PwLinkGroupIface::stateChanged); - QObject::connect(group, &QObject::destroyed, this, [this]() { delete this; }); } void PwLinkGroupIface::ref() { this->mGroup->ref(); }