reporter: Properly reset g_log handler when reporter is destroyed

Reviewed-by: Thibault Saunier <tsaunier@gnome.org>
Differential Revision: https://phabricator.freedesktop.org/D699
This commit is contained in:
Thibault Saunier 2016-01-22 12:58:31 +01:00 committed by Thibault Saunier
parent 2d5c6a749c
commit 1d9c2d2a0b

View file

@ -233,6 +233,17 @@ done:
g_free (message);
}
static void
gst_validate_reporter_destroyed (gpointer udata, GObject * freed_reporter)
{
g_log_set_handler ("GStreamer",
G_LOG_LEVEL_MASK, (GLogFunc) g_log_default_handler, NULL);
g_log_set_handler ("GLib",
G_LOG_LEVEL_MASK, (GLogFunc) g_log_default_handler, NULL);
g_log_set_handler ("GLib-GObject",
G_LOG_LEVEL_MASK, (GLogFunc) g_log_default_handler, NULL);
}
static void
gst_validate_reporter_g_log_func (const gchar * log_domain,
GLogLevelFlags log_level, const gchar * message,
@ -350,6 +361,9 @@ gst_validate_reporter_set_handle_g_logs (GstValidateReporter * reporter)
G_LOG_LEVEL_MASK, (GLogFunc) gst_validate_reporter_g_log_func, reporter);
g_log_handler = gst_validate_reporter_get_priv (reporter);
g_object_weak_ref (G_OBJECT (reporter), gst_validate_reporter_destroyed,
NULL);
}
/**