From dae4375d08dce33b0f65f303bd5ae6edaecef3cb Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 21 Nov 2006 22:35:48 +0000 Subject: [PATCH] 2006-11-21 Emmanuele Bassi * clutter/clutter-main.c: Add a --g-fatal-warnings switch for abort()-ing on warnings and criticals. --- ChangeLog | 5 +++++ clutter/clutter-main.c | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/ChangeLog b/ChangeLog index f69d40f..02561c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2006-11-21 Emmanuele Bassi + * clutter/clutter-main.c: Add a --g-fatal-warnings switch + for abort()-ing on warnings and criticals. + +2006-11-21 Emmanuele Bassi + * configure.ac: Enable debug messages also when --enable-debug is set to "minimum". diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index 2f99cab..bc44961 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -45,6 +45,7 @@ static gboolean clutter_is_initialized = FALSE; static gboolean clutter_show_fps = FALSE; +static gboolean clutter_fatal_warnings = FALSE; static gchar *clutter_display_name = NULL; static int clutter_screen = 0; @@ -561,6 +562,8 @@ static GOptionEntry clutter_args[] = { "X screen to use", "SCREEN" }, { "clutter-show-fps", 0, 0, G_OPTION_ARG_NONE, &clutter_show_fps, "Show frames per second", NULL }, + { "g-fatal-warnings", 0, 0, G_OPTION_ARG_NONE, &clutter_fatal_warnings, + "Make all warnings fatal", NULL }, #ifdef CLUTTER_ENABLE_DEBUG { "clutter-debug", 0, 0, G_OPTION_ARG_CALLBACK, clutter_arg_debug_cb, "Clutter debugging flags to set", "FLAGS" }, @@ -624,6 +627,18 @@ post_parse_hook (GOptionContext *context, { ClutterMainContext *clutter_context; + if (clutter_is_initialized) + return TRUE; + + if (clutter_fatal_warnings) + { + GLogLevelFlags fatal_mask; + + fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK); + fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL; + g_log_set_always_fatal (fatal_mask); + } + clutter_context = clutter_context_get_default (); clutter_context->main_loops = NULL; clutter_context->main_loop_level = 0; -- 2.7.4