decodebin3: Tidy-up dispose function

Protect code with mutexes

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5607>
This commit is contained in:
Philippe Normand 2023-10-31 16:27:55 +00:00 committed by GStreamer Marge Bot
parent f0e1b4f415
commit ca18e48882

View file

@ -702,6 +702,7 @@ gst_decodebin3_dispose (GObject * object)
gst_decodebin3_reset (dbin); gst_decodebin3_reset (dbin);
g_mutex_lock (&dbin->factories_lock);
if (dbin->factories) { if (dbin->factories) {
gst_plugin_feature_list_free (dbin->factories); gst_plugin_feature_list_free (dbin->factories);
dbin->factories = NULL; dbin->factories = NULL;
@ -714,8 +715,13 @@ gst_decodebin3_dispose (GObject * object)
g_list_free (dbin->decodable_factories); g_list_free (dbin->decodable_factories);
dbin->decodable_factories = NULL; dbin->decodable_factories = NULL;
} }
g_mutex_unlock (&dbin->factories_lock);
SELECTION_LOCK (dbin);
if (dbin->collection) {
gst_clear_object (&dbin->collection); gst_clear_object (&dbin->collection);
}
SELECTION_UNLOCK (dbin);
INPUT_LOCK (dbin); INPUT_LOCK (dbin);
if (dbin->main_input) { if (dbin->main_input) {