From 194964b4e03def69fc4c6c04bfa8e4e7daa2522e Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 9 May 2016 16:56:56 +0200 Subject: [PATCH] gst_deinit: move down tracers cleaning We want the tracer detecting leaks to be finalized as late as possible to give the chance to other gst components to be properly cleaned first. https://bugzilla.gnome.org/show_bug.cgi?id=765052 --- gst/gst.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gst/gst.c b/gst/gst.c index d508390b82..33a5a62b5a 100644 --- a/gst/gst.c +++ b/gst/gst.c @@ -996,10 +996,6 @@ gst_deinit (void) GST_DEBUG ("already deinitialized"); return; } -#ifndef GST_DISABLE_GST_DEBUG - _priv_gst_tracing_deinit (); -#endif - g_thread_pool_set_max_unused_threads (0); bin_class = GST_BIN_CLASS (g_type_class_peek (gst_bin_get_type ())); if (bin_class->pool != NULL) { @@ -1024,6 +1020,14 @@ gst_deinit (void) _priv_gst_registry_cleanup (); _priv_gst_allocator_cleanup (); + + /* We want to destroy tracers as late as possible for the leaks tracer + * but still need to keep the caps system alive as it may have to use + * gst_caps_to_string() to display leaked caps. */ +#ifndef GST_DISABLE_GST_DEBUG + _priv_gst_tracing_deinit (); +#endif + _priv_gst_caps_features_cleanup (); _priv_gst_caps_cleanup ();