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.
This commit is contained in:
Emmanuele Bassi 2015-01-01 15:07:19 +00:00
parent eb51f6cf10
commit 5b9c6f49c4

View File

@ -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);
}