minor, s/g_print/g_printf
[systembsd.git] / src / interfaces / localed / localed.c
index 27448acb59e0fa832ffb56a44ff6c6dca578a975..160caafa932d40e628d33030a27fd7a7016621a5 100644 (file)
@@ -70,7 +70,7 @@ static void localed_on_bus_acquired(GDBusConnection *conn,
                                     const gchar *name,
                                     gpointer user_data) {
 
-    g_print("got bus/name, exporting %s's interface...\n", name);
+    g_printf("got bus/name, exporting %s's interface...\n", name);
  
     localed_interf = locale1_skeleton_new();
 
@@ -152,6 +152,8 @@ void set_signal_handlers() {
 
 int main() {
 
+       set_signal_handlers();
+
        localed_loop = g_main_loop_new(NULL, TRUE);
        localed_freeable = g_ptr_array_new();
 
@@ -165,11 +167,14 @@ int main() {
                                     NULL);
 
        g_main_loop_run(localed_loop);
+       /* runs until single g_main_loop_quit() call is raised inside <interface>_mem_clean() */
        g_main_loop_unref(localed_loop);
 
+       /* guaranteed unownable */
        g_bus_unown_name(bus_descriptor);
 
-       localed_mem_clean();
+       /* at this point no operations can occur with our data, it is safe to free it + its container */
+       g_ptr_array_free(localed_freeable, TRUE);
 
        return 0;
 }