diff --git a/src/usb_moded-appsync-dbus.c b/src/usb_moded-appsync-dbus.c index cce25db..1c773f3 100644 --- a/src/usb_moded-appsync-dbus.c +++ b/src/usb_moded-appsync-dbus.c @@ -274,8 +274,10 @@ gboolean usb_moded_app_sync_init_connection(void) /* Make sure we do not get forced to exit if dbus session dies or stops */ dbus_connection_set_exit_on_disconnect(dbus_connection_ses, FALSE); - /* Connect D-Bus to the mainloop */ + /* Connect D-Bus to the mainloop (Seems it is only needed once and is done at the main + D-Bus init dbus_connection_setup_with_g_main(dbus_connection_ses, NULL); + */ /* Request service name */ if( !usb_moded_app_sync_obtain_name() ) @@ -318,6 +320,7 @@ gboolean usb_moded_app_sync_init(void) */ void usb_moded_appsync_cleanup(void) { + usb_moded_app_sync_cleanup_connection(); // NOP } diff --git a/src/usb_moded-appsync.c b/src/usb_moded-appsync.c index 3a031ab..895c7b1 100644 --- a/src/usb_moded-appsync.c +++ b/src/usb_moded-appsync.c @@ -55,10 +55,11 @@ static void free_elem(gpointer aptr) struct list_elem *elem = aptr; free(elem->name); free(elem->launch); + free(elem->mode); free(elem); } -static void free_list(void) +void free_appsync_list(void) { if( sync_list != 0 ) { @@ -66,6 +67,7 @@ static void free_list(void) g_list_foreach (sync_list, (GFunc) free_elem, NULL); g_list_free (sync_list); sync_list = 0; + log_debug("Appsync list freed\n"); } } @@ -76,7 +78,7 @@ void readlist(void) const gchar *dirname; struct list_elem *list_item; - free_list(); + free_appsync_list(); if( !(confdir = g_dir_open(CONF_DIR_PATH, 0, NULL)) ) goto cleanup; diff --git a/src/usb_moded-appsync.h b/src/usb_moded-appsync.h index 1902ccc..91e3345 100644 --- a/src/usb_moded-appsync.h +++ b/src/usb_moded-appsync.h @@ -47,3 +47,5 @@ void readlist(void); int activate_sync(const char *mode); int mark_active(const gchar *name); int appsync_stop(void); +void free_appsync_list(void); +void usb_moded_appsync_cleanup(void);