Skip to content

LibWebRTCMediaEndpoint::m_peerConnectionBackend should be a WeakPtr, not a WeakRef #47171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

youennf
Copy link
Contributor

@youennf youennf commented Jun 25, 2025

1c6bc74

LibWebRTCMediaEndpoint::m_peerConnectionBackend should be a WeakPtr, not a WeakRef
https://bugs.webkit.org/show_bug.cgi?id=294958
rdar://145704687

Reviewed by Jean-Yves Avenard.

LibWebRTCMediaEndpoint is refcounted, we cannot ensure that it will be destroyed before its m_peerConnectionBackend.
We make m_peerConnectionBackend a WeakPtr and we add a missing check in LibWebRTCMediaEndpoint::OnStatsDelivered.

* Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::setConfiguration):
(WebCore::LibWebRTCMediaEndpoint::protectedPeerConnectionBackend const):
(WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
* Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:

Canonical link: https://commits.webkit.org/296615@main

0aa82cf

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ⏳ 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🛠 🧪 merge ✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 ✅ 🛠 playstation
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

@youennf youennf self-assigned this Jun 25, 2025
@youennf youennf added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label Jun 25, 2025
@youennf youennf marked this pull request as ready for review June 25, 2025 08:26
@youennf youennf added the merge-queue Applied to send a pull request to merge-queue label Jun 25, 2025
…not a WeakRef

https://bugs.webkit.org/show_bug.cgi?id=294958
rdar://145704687

Reviewed by Jean-Yves Avenard.

LibWebRTCMediaEndpoint is refcounted, we cannot ensure that it will be destroyed before its m_peerConnectionBackend.
We make m_peerConnectionBackend a WeakPtr and we add a missing check in LibWebRTCMediaEndpoint::OnStatsDelivered.

* Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::setConfiguration):
(WebCore::LibWebRTCMediaEndpoint::protectedPeerConnectionBackend const):
(WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered):
* Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:

Canonical link: https://commits.webkit.org/296615@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/LibWebRTCMediaEndpoint-m_peerConnectionBackend-should-be-a-WeakPtr-not-a-WeakRef branch from 0aa82cf to 1c6bc74 Compare June 25, 2025 14:36
@webkit-commit-queue
Copy link
Collaborator

Committed 296615@main (1c6bc74): https://commits.webkit.org/296615@main

Reviewed commits have been landed. Closing PR #47171 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 1c6bc74 into WebKit:main Jun 25, 2025
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Bugs Unclassified bugs are placed in this component until the correct component can be determined.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants