Commit 66d47c2c authored by Philippe De Swert's avatar Philippe De Swert

Clean up appsync list and dbus correctly

Signed-off-by: default avatarPhilippe De Swert <philippe.deswert@jollamobile.com>
parent 31852791
......@@ -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 @@ EXIT:
*/
void usb_moded_appsync_cleanup(void)
{
usb_moded_app_sync_cleanup_connection();
// NOP
}
......
......@@ -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;
......
......@@ -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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment