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();
+ g_type_init ();
+ if (!g_thread_supported ())
+ g_thread_init (NULL);
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;
}
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;
}