Bug 1942551 - WebRTC backport: PipeWire camera: Fix cleanup order a=pascalc

The hook is associated with the proxy object. We should remove the hook
first before destroying the proxy object to avoid use-after-free.

This is a simple backport of an WebRTC upstream change.

Upstream commit: caa8ef3ab511d54dfa486eb7599ef0a74f7471ee

Original Revision: https://phabricator.services.mozilla.com/D239886

Differential Revision: https://phabricator.services.mozilla.com/D240592
This commit is contained in:
Jan Grulich 2025-03-06 13:59:04 +00:00
parent 77083f780d
commit 198851a7d3
2 changed files with 3 additions and 1 deletions

View file

@ -68,8 +68,8 @@ PipeWireNode::PipeWireNode(PipeWireSession* session,
}
PipeWireNode::~PipeWireNode() {
pw_proxy_destroy(proxy_);
spa_hook_remove(&node_listener_);
pw_proxy_destroy(proxy_);
}
// static

View file

@ -0,0 +1,2 @@
We cherry-picked this in bug 1942551.