pad: Keep IDLE probe hook alive during immediate callback
authorJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>
Tue, 24 Aug 2021 12:53:30 +0000 (14:53 +0200)
committerJan Alexander Steffens (heftig) <jan.steffens@ltnglobal.com>
Tue, 24 Aug 2021 13:13:19 +0000 (15:13 +0200)
commit148ac71a1fa8b698a8232b714f84419f51bda5ef
tree3003a81047a14039193bf535bfcbc0ba2753d846
parent637b0d8dc25b660d3b05370e60a95249a5228a39
pad: Keep IDLE probe hook alive during immediate callback

When the probe returns GST_PAD_PROBE_REMOVE and gets called concurrently
from the streaming thread while we're in the callback here, the hook has
already been destroyed by the time we've reacquired the object lock.
Consequently, cleanup_hook gets passed an invalid pointer.

Keep another reference to the hook alive to avoid this situation.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/873>
gst/gstpad.c