d2d-manager: remove unnecessary timer callback which causes mot-agent crash
authorsaerome.kim <saerome.kim@samsung.com>
Wed, 11 Apr 2018 12:11:37 +0000 (21:11 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Mon, 2 Jul 2018 10:38:50 +0000 (19:38 +0900)
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
src/companion-manager/src/comp_group.c
src/companion-manager/src/comp_mot_agent.c

index 088e635..6aa2306 100644 (file)
@@ -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) {
index e2016f3..6e44f1f 100644 (file)
@@ -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;
 }