Bug 1942551 - WebRTC backport: PipeWire camera: Fix cleanup order r=pehrsons,webrtc-reviewers

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

Differential Revision: https://phabricator.services.mozilla.com/D239886
This commit is contained in:
Jan Grulich
2025-03-04 13:45:00 +00:00
parent ace44e54c1
commit c61dd19ea9
2 changed files with 3 additions and 1 deletions

View File

@@ -58,8 +58,8 @@ VideoType PipeWireRawFormatToVideoType(uint32_t id) {
void PipeWireNode::PipeWireNodeDeleter::operator()(
PipeWireNode* node) const noexcept {
pw_proxy_destroy(node->proxy_);
spa_hook_remove(&node->node_listener_);
pw_proxy_destroy(node->proxy_);
}
// static

View File

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