rtmp2/connection: pass the parent cancellable down to the connection
authorMatthew Waters <matthew@centricular.com>
Fri, 4 Dec 2020 06:02:00 +0000 (17:02 +1100)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 8 Dec 2020 23:43:02 +0000 (23:43 +0000)
commit1f7515100caf06fb31d84a40be49dcefd176fce3
treeb8449560a007b1ddcf43a4c5aaa1f95588c9af4f
parent470e6989d27b7a103cce096956c5721640d11950
rtmp2/connection: pass the parent cancellable down to the connection

Otherwise, when rtpm2src cancels an inflight operation that has a queued
message stored, then the rtmp connection operation is not stopped.

If the cancellation occurs during rtmp connection start up, then
rtpm2src does not have any way of accessing the connection object as it
has not been returned yet.  As a result, rtpm2src will cancel, the
connection will still be processing things and the
GMainContext/GMainLoop associated with the outstanding operation will be
destroyed.  All outstanding operations and the rtmpconnection object will
therefore be leaked in this case.

Fixes: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/issues/1425
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1862>
gst/rtmp2/rtmp/rtmpclient.c
gst/rtmp2/rtmp/rtmpconnection.c
gst/rtmp2/rtmp/rtmpconnection.h