From 2a34b24f7f525c7e031fa572ce32e6db8d58cc47 Mon Sep 17 00:00:00 2001 From: "saerome.kim" Date: Wed, 11 Apr 2018 21:11:37 +0900 Subject: [PATCH] d2d-manager: remove unnecessary timer callback which causes mot-agent crash Signed-off-by: saerome.kim --- src/companion-manager/src/comp_group.c | 3 +++ src/companion-manager/src/comp_mot_agent.c | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/companion-manager/src/comp_group.c b/src/companion-manager/src/comp_group.c index 088e635..6aa2306 100644 --- a/src/companion-manager/src/comp_group.c +++ b/src/companion-manager/src/comp_group.c @@ -801,6 +801,9 @@ GVariant *comp_group_get_my_mowned_devices() GVariantBuilder builder; GVariant *group_data; + comp_remove_ip_info(); + comp_make_ip_info(); + g_variant_builder_init(&builder, G_VARIANT_TYPE("a{sv}")); if (my_device != NULL) { diff --git a/src/companion-manager/src/comp_mot_agent.c b/src/companion-manager/src/comp_mot_agent.c index e2016f3..6e44f1f 100644 --- a/src/companion-manager/src/comp_mot_agent.c +++ b/src/companion-manager/src/comp_mot_agent.c @@ -93,7 +93,7 @@ static gboolean _find_device_timeout_cb(gpointer data) int agent_find_mot_enable_devices(int timeout) { GVariant *variant = NULL; - int result = COMP_ERROR_NONE; + int result = COMP_ERROR_UNKNOWN; GError *error = NULL; if (NULL == agent.dbus_connection || NULL == agent.gproxy_agent_service) { @@ -113,8 +113,8 @@ int agent_find_mot_enable_devices(int timeout) g_error_free(error); return COMP_ERROR_IO_ERROR; } - - g_timeout_add_seconds(timeout + 1, _find_device_timeout_cb, NULL); + if (COMP_ERROR_NONE == result) + g_timeout_add_seconds(timeout + 1, _find_device_timeout_cb, NULL); return result; } @@ -134,7 +134,7 @@ static gboolean _find_mowned_device_timeout_cb(gpointer data) int agent_find_mowned_devices(int timeout) { GVariant *variant = NULL; - int result = COMP_ERROR_NONE; + int result = COMP_ERROR_UNKNOWN; GError *error = NULL; if (NULL == agent.dbus_connection || NULL == agent.gproxy_agent_service) { @@ -152,8 +152,8 @@ int agent_find_mowned_devices(int timeout) g_error_free(error); return COMP_ERROR_IO_ERROR; } - - g_timeout_add_seconds(timeout + 1, _find_mowned_device_timeout_cb, NULL); + if (COMP_ERROR_NONE == result) + g_timeout_add_seconds(timeout + 1, _find_mowned_device_timeout_cb, NULL); return result; } -- 2.7.4