mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-20 06:08:14 +00:00
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:
parent
2d5c6a749c
commit
1d9c2d2a0b
1 changed files with 14 additions and 0 deletions
|
@ -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);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue