Remove timeout before exiting main loop

Also xfconf_shutdown() should be called last in main(), just as
xfconf_init() is called first, so swap these two things.

Fixes: #72
This commit is contained in:
Gaël Bonithon
2023-03-10 23:36:20 +01:00
parent 8abbd3bd3a
commit ac4c09cab8

View File

@@ -103,7 +103,8 @@ static void
destroy_window (void) destroy_window (void)
{ {
if (gtk_main_level () > 0) { if (gtk_main_level () > 0) {
xfconf_shutdown(); if (timer_id > 0)
g_source_remove (timer_id);
gtk_main_quit (); gtk_main_quit ();
} }
} }
@@ -113,7 +114,8 @@ delete_window (void)
{ {
if (!status_icon_get_visible ()) if (!status_icon_get_visible ())
{ {
xfconf_shutdown(); if (timer_id > 0)
g_source_remove (timer_id);
gtk_main_quit (); gtk_main_quit ();
return FALSE; return FALSE;
} }
@@ -271,8 +273,7 @@ int main (int argc, char *argv[])
else else
g_warning ("Nothing to do: activate hiding to the notification area when using --start-hidden"); g_warning ("Nothing to do: activate hiding to the notification area when using --start-hidden");
if (timer_id > 0) xfconf_shutdown();
g_source_remove (timer_id);
return 0; return 0;
} }