[clutter/clutter-1.22] Improve the warning message in clutter_main_quit()



commit 5b9c6f49c454b94c705f259b8c6f27ded89abb91
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu Jan 1 15:07:19 2015 +0000

    Improve the warning message in clutter_main_quit()
    
    If you call clutter_main_quit() without calling clutter_main()
    
    [ South Park ski instructor]
    
    You're going to have a bad time.

 clutter/clutter-main.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c
index dcc7f75..866d02b 100644
--- a/clutter/clutter-main.c
+++ b/clutter/clutter-main.c
@@ -772,7 +772,15 @@ clutter_get_text_direction (void)
 void
 clutter_main_quit (void)
 {
-  g_return_if_fail (main_loops != NULL);
+  if (main_loops == NULL)
+    {
+      g_critical ("Calling clutter_main_quit() without calling clutter_main() "
+                  "is not allowed. If you are using another main loop, use the "
+                  "appropriate API to terminate it.");
+      return;
+    }
+
+  CLUTTER_NOTE (MISC, "Terminating main loop level %d", clutter_main_loop_level);
 
   g_main_loop_quit (main_loops->data);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]