free pipewire listeners on proxy destruction

This commit is contained in:
Erik Reider
2023-10-31 08:46:21 +01:00
parent c4226f3745
commit c60a8e9836
2 changed files with 23 additions and 4 deletions

View File

@ -29,7 +29,8 @@ class PrivacyNodeInfo {
std::string pipewire_access_portal_app_id;
std::string application_icon_name;
struct spa_hook node_listener;
struct spa_hook object_listener;
struct spa_hook proxy_listener;
bool changed = false;
@ -37,7 +38,10 @@ class PrivacyNodeInfo {
PrivacyNodeInfo(uint32_t id_, void *data_) : id(id_), data(data_) {}
~PrivacyNodeInfo() { spa_hook_remove(&node_listener); }
~PrivacyNodeInfo() {
spa_hook_remove(&object_listener);
spa_hook_remove(&proxy_listener);
}
std::string get_name() {
const std::vector<std::string *> names{&application_name, &node_name};