mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-30 11:08:34 +00:00
validate: Keep trying to print stack traces when our log hanlder is removed
There are cases where a crash happens after the program ends
This commit is contained in:
parent
68573ae919
commit
ba9b2c5ec5
1 changed files with 17 additions and 3 deletions
|
@ -256,15 +256,29 @@ done:
|
|||
g_free (message);
|
||||
}
|
||||
|
||||
static void
|
||||
gst_validate_default_log_hanlder (const gchar * log_domain,
|
||||
GLogLevelFlags log_level, const gchar * message, gpointer user_data)
|
||||
{
|
||||
gchar *trace = gst_debug_get_stack_trace (GST_STACK_TRACE_SHOW_FULL);
|
||||
|
||||
if (trace) {
|
||||
g_print ("\nStack trace:\n%s\n", trace);
|
||||
g_free (trace);
|
||||
}
|
||||
|
||||
g_log_default_handler (log_domain, log_level, message, user_data);
|
||||
}
|
||||
|
||||
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_LEVEL_MASK, (GLogFunc) gst_validate_default_log_hanlder, NULL);
|
||||
g_log_set_handler ("GLib",
|
||||
G_LOG_LEVEL_MASK, (GLogFunc) g_log_default_handler, NULL);
|
||||
G_LOG_LEVEL_MASK, (GLogFunc) gst_validate_default_log_hanlder, NULL);
|
||||
g_log_set_handler ("GLib-GObject",
|
||||
G_LOG_LEVEL_MASK, (GLogFunc) g_log_default_handler, NULL);
|
||||
G_LOG_LEVEL_MASK, (GLogFunc) gst_validate_default_log_hanlder, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in a new issue