diff --git a/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp b/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp index 13245a88cb21..34eeba0a9446 100644 --- a/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp +++ b/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.cpp @@ -80,6 +80,13 @@ GStreamerMediaEndpoint::GStreamerMediaEndpoint(GStreamerPeerConnectionBackend& p }); } +GStreamerMediaEndpoint::~GStreamerMediaEndpoint() +{ + if (!m_pipeline) + return; + teardownPipeline(); +} + bool GStreamerMediaEndpoint::initializePipeline() { static uint32_t nPipeline = 0; @@ -176,6 +183,7 @@ bool GStreamerMediaEndpoint::initializePipeline() void GStreamerMediaEndpoint::teardownPipeline() { ASSERT(m_pipeline); + GST_DEBUG_OBJECT(m_pipeline.get(), "Tearing down."); #if !RELEASE_LOG_DISABLED stopLoggingStats(); #endif diff --git a/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.h b/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.h index b1e9ba285f2b..af48a36f86b8 100644 --- a/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.h +++ b/Source/WebCore/Modules/mediastream/gstreamer/GStreamerMediaEndpoint.h @@ -52,7 +52,7 @@ class GStreamerMediaEndpoint : public ThreadSafeRefCounted create(GStreamerPeerConnectionBackend& peerConnection) { return adoptRef(*new GStreamerMediaEndpoint(peerConnection)); } - ~GStreamerMediaEndpoint() = default; + ~GStreamerMediaEndpoint(); bool setConfiguration(MediaEndpointConfiguration&); void restartIce();