summaryrefslogtreecommitdiff
path: root/gst/gstpad.c
diff options
context:
space:
mode:
authorMiguel Paris <mparisdiaz@gmail.com>2021-04-16 11:14:31 +0200
committerMiguel Paris <mparisdiaz@gmail.com>2021-04-19 14:58:43 +0200
commitfad603011d590a2c568730ffc3adf1d6bf5a778e (patch)
tree818858f8145c2afd7bfc0b3121c2520c6b10ccfb /gst/gstpad.c
parent4eef67cc7ec36903801e3bbb62b43411b1f00b94 (diff)
downloadgstreamer-fad603011d590a2c568730ffc3adf1d6bf5a778e.tar.gz
pad: clear probes holding mutex
Protect clearing probes against concurrent modification which might happen due to dispose does NOT guarantee that the object is not used anymore, as it could be referenced again and so being continued used. So, as in the rest of places where probes hook list is used, on dispose it should be accessed holding the mutex "GST_OBJECT_LOCK (pad);" as GHookList is not thread-safe. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/798>
Diffstat (limited to 'gst/gstpad.c')
-rw-r--r--gst/gstpad.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gst/gstpad.c b/gst/gstpad.c
index 93a7a65ef4..a5affa2a93 100644
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
@@ -723,9 +723,8 @@ gst_pad_dispose (GObject * object)
GST_OBJECT_LOCK (pad);
remove_events (pad);
- GST_OBJECT_UNLOCK (pad);
-
g_hook_list_clear (&pad->probes);
+ GST_OBJECT_UNLOCK (pad);
G_OBJECT_CLASS (parent_class)->dispose (object);
}