Move code from loudgame_run to new loudgame_fini for clarity
authorCarl Worth <cworth@cworth.org>
Tue, 22 Jan 2008 01:04:27 +0000 (17:04 -0800)
committerCarl Worth <cworth@cworth.org>
Tue, 22 Jan 2008 01:04:27 +0000 (17:04 -0800)
loudgame.c

index 65aeb35f31ab95cfe420dbfb526b874b6997f452..f09910f3611aa8e8866879cdec8cff597c870c1f 100644 (file)
@@ -237,6 +237,12 @@ loudgame_init (loudgame_t *lg, int argc, char **argv)
     return 0;
 }
 
+static void
+loudgame_fini (loudgame_t *lg)
+{
+    g_main_loop_unref (lg->main_loop);
+}
+
 int
 loudgame_run (loudgame_t *lg)
 {
@@ -244,7 +250,7 @@ loudgame_run (loudgame_t *lg)
 
     g_main_loop_run (lg->main_loop);
 
-    g_main_loop_unref (lg->main_loop);
+    loudgame_fini (lg);
                                                                                 
     return lg->return_value;
 }