Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: bf68b55937f3bf63510b133f01ea3f1ab1b467d6
      
https://github.com/WebKit/WebKit/commit/bf68b55937f3bf63510b133f01ea3f1ab1b467d6
  Author: Adrian Perez de Castro <[email protected]>
  Date:   2025-10-13 (Mon, 13 Oct 2025)

  Changed paths:
    M Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp
    M 
Source/WebCore/Modules/mediastream/gstreamer/GStreamerPeerConnectionBackend.cpp
    M 
Source/WebCore/Modules/mediastream/gstreamer/GStreamerPeerConnectionBackend.h

  Log Message:
  -----------
  [GStreamer] Clang warns  about returning stack value in 
GStreamerPeerConnectionBackend.cpp
https://bugs.webkit.org/show_bug.cgi?id=300616

Reviewed by Philippe Normand.

The newly created transceiver is kept alive by the RTCPeerConnection
after the call to RTCPeerConnection::addInternalTransceiver(), and
therefore it is valid to return its address. The added annotations
to the Ref template in 301385@main make Clang notice that, indeed a
reference to a stack-local variable is returned because Ref::get()
does exactly that. Returning the pointer directly using Ref::ptr()
sidesteps the issue, and avoid needing to apply the & operator later
on. While at at it, move the Ref into the addInternalTransceiver()
call to avoid reference count churn.

* Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp:
(WebCore::GStreamerMediaEndpoint::connectIncomingTrack):
* 
Source/WebCore/Modules/mediastream/gstreamer/GStreamerPeerConnectionBackend.cpp:
(WebCore::GStreamerPeerConnectionBackend::newRemoteTransceiver):
* Source/WebCore/Modules/mediastream/gstreamer/GStreamerPeerConnectionBackend.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to