Fixed WATC movie service interface
[maevies] / src / maevies-service.c
index 739a6be..c2f71aa 100644 (file)
 int
 main (int argc, char **argv)
 {
-        MvsMInfoProviderService *service;
-        DBusGConnection *connection;
+        MvsMInfoProviderService *service = NULL;
+        DBusGConnection *connection = NULL;
         GError *error = NULL;
-        GMainLoop *loop;
+        GMainLoop *loop = NULL;
 
+        g_type_init ();
         if (!g_thread_supported ())
                 g_thread_init (NULL);
-        g_type_init ();
 
         connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
         if (connection == NULL) {
-                g_warning ("Unable to connect to dbus: %sn", error->message);
+                g_warning ("Unable to connect to dbus: %s", error->message);
                 g_error_free (error);
                 return -1;
         }
@@ -45,6 +45,9 @@ main (int argc, char **argv)
         g_main_loop_run (loop);
 
         g_object_unref (service);
+        g_main_loop_unref (loop);
+        dbus_g_connection_unref (connection);
+        g_error_free (error);
 
         return 0;
 }