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.
This commit is contained in:
outfoxxed 2024-09-17 23:44:41 -07:00
parent 931aca5392
commit 7f9762be53
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E

View file

@ -220,6 +220,8 @@ PwNodeLinkTracker::linkGroupAt(QQmlListProperty<PwLinkGroupIface>* 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(); }