Add the sender name in signal subscribe function
[platform/core/connectivity/bluetooth-frwk.git] / bt-service-adaptation / services / obex / bt-service-map-client.c
index 15c0e85..326b2e8 100644 (file)
@@ -138,6 +138,7 @@ int _bt_destroy_session_sync(const char* session_id)
        GDBusConnection *g_conn;
        GDBusProxy *session_proxy;
        GError *err = NULL;
+       GVariant *result;
 
        retv_if(session_id == NULL, BLUETOOTH_ERROR_INVALID_PARAM);
 
@@ -158,13 +159,16 @@ int _bt_destroy_session_sync(const char* session_id)
 
        GVariant *param = g_variant_new("(o)", session_id);
 
-       g_dbus_proxy_call_sync(session_proxy, "RemoveSession", param,
+       result = g_dbus_proxy_call_sync(session_proxy, "RemoveSession", param,
                        G_DBUS_CALL_FLAGS_NONE, -1, NULL, &err);
-       if (err != NULL) {
-               BT_ERR("Could not remove session: %s\n", err->message);
-               g_error_free(err);
-               return BLUETOOTH_ERROR_INTERNAL;
+       if (!result) {
+               if (err) {
+                       BT_ERR("Could not remove session: %s\n", err->message);
+                       g_error_free(err);
+                       return BLUETOOTH_ERROR_INTERNAL;
+               }
        } else {
+               g_variant_unref(result);
                BT_DBG("remove session succeed\n");
        }