forked from quickshell/quickshell
		
	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:
		
							parent
							
								
									931aca5392
								
							
						
					
					
						commit
						7f9762be53
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -220,6 +220,8 @@ PwNodeLinkTracker::linkGroupAt(QQmlListProperty<PwLinkGroupIface>* property, qsi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void PwNodeLinkTracker::onNodeDestroyed() {
 | 
					void PwNodeLinkTracker::onNodeDestroyed() {
 | 
				
			||||||
	this->mNode = nullptr;
 | 
						this->mNode = nullptr;
 | 
				
			||||||
 | 
						QObject::disconnect(&PwConnection::instance()->registry, nullptr, this, nullptr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	this->updateLinks();
 | 
						this->updateLinks();
 | 
				
			||||||
	emit this->nodeChanged();
 | 
						emit this->nodeChanged();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -350,7 +352,6 @@ PwLinkIface* PwLinkIface::instance(PwLink* link) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PwLinkGroupIface::PwLinkGroupIface(PwLinkGroup* group): QObject(group), mGroup(group) {
 | 
					PwLinkGroupIface::PwLinkGroupIface(PwLinkGroup* group): QObject(group), mGroup(group) {
 | 
				
			||||||
	QObject::connect(group, &PwLinkGroup::stateChanged, this, &PwLinkGroupIface::stateChanged);
 | 
						QObject::connect(group, &PwLinkGroup::stateChanged, this, &PwLinkGroupIface::stateChanged);
 | 
				
			||||||
	QObject::connect(group, &QObject::destroyed, this, [this]() { delete this; });
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void PwLinkGroupIface::ref() { this->mGroup->ref(); }
 | 
					void PwLinkGroupIface::ref() { this->mGroup->ref(); }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue