summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wifi-aware-data-path.c5
-rw-r--r--src/wifi-aware-gdbus.c1
-rw-r--r--src/wifi-aware-private.c20
3 files changed, 21 insertions, 5 deletions
diff --git a/src/wifi-aware-data-path.c b/src/wifi-aware-data-path.c
index f72fc5e..dd753f5 100644
--- a/src/wifi-aware-data-path.c
+++ b/src/wifi-aware-data-path.c
@@ -215,8 +215,11 @@ static void __data_path_invoke_callback(wifi_aware_data_path_h data_path, wifi_a
RET_IF(data_path == NULL, "data path handle is NULL");
wifi_aware_data_path_s *ndp = (wifi_aware_data_path_s *)data_path;
- if (ndp->open_cb)
+ if (ndp->open_cb) {
ndp->open_cb(data_path, error, ndp->open_cb_user_data);
+ ndp->open_cb = NULL;
+ ndp->open_cb_user_data = NULL;
+ }
}
static wifi_aware_error_e __parsing_data_path_confirmed_event(GVariant *parameters,
diff --git a/src/wifi-aware-gdbus.c b/src/wifi-aware-gdbus.c
index 91044a9..78e5c31 100644
--- a/src/wifi-aware-gdbus.c
+++ b/src/wifi-aware-gdbus.c
@@ -94,6 +94,7 @@ void wifi_aware_gdbus_deregister_signal(guint signal_id)
{
__WIFI_AWARE_FUNC_ENTER__;
g_dbus_connection_signal_unsubscribe(gdbus_data.connection, signal_id);
+ __WIFI_AWARE_FUNC_EXIT__;
}
int wifi_aware_gdbus_init()
diff --git a/src/wifi-aware-private.c b/src/wifi-aware-private.c
index b4b5862..4cecdaa 100644
--- a/src/wifi-aware-private.c
+++ b/src/wifi-aware-private.c
@@ -238,8 +238,11 @@ static void __enable_request_reply(GObject *src, GAsyncResult *res, gpointer use
error = _wifi_aware_convert_nan_manager_error(nan_error);
}
- if (g_wifi_aware->enabled_cb)
+ if (g_wifi_aware->enabled_cb) {
g_wifi_aware->enabled_cb(error, g_wifi_aware->enabled_cb_data);
+ g_wifi_aware->enabled_cb = NULL;
+ g_wifi_aware->enabled_cb_data = NULL;
+ }
}
static void __session_add_published_callback(wifi_aware_session_h session,
@@ -268,8 +271,11 @@ static void __wifi_aware_publish_invoke_callback(wifi_aware_session_h session,
RET_IF(session == NULL, "Session is NULL");
wifi_aware_session_s *handle = (wifi_aware_session_s *)session;
- if (handle->published_cb)
+ if (handle->published_cb) {
handle->published_cb(session, error, handle->published_cb_data);
+ handle->published_cb = NULL;
+ handle->published_cb_data = NULL;
+ }
}
static void __wifi_aware_discovered_cb(wifi_aware_session_h session, wifi_aware_peer_h peer,
@@ -363,8 +369,11 @@ static void __wifi_aware_subscribe_invoke_callback(wifi_aware_session_h session,
RET_IF(session == NULL, "Session is NULL");
wifi_aware_session_s *handle = (wifi_aware_session_s *)session;
- if (handle->subscribed_cb)
+ if (handle->subscribed_cb) {
handle->subscribed_cb(session, error, handle->subscribed_cb_data);
+ handle->subscribed_cb = NULL;
+ handle->subscribed_cb_data = NULL;
+ }
}
static void __subscribe_request_reply(GObject *src, GAsyncResult *res, gpointer user_data)
@@ -1143,8 +1152,11 @@ void __destroy_message_data(wifi_aware_message_s *message)
static void __wifi_aware_followup_invoke_callback(wifi_aware_message_s *message, wifi_aware_error_e error)
{
- if (message && message->callback)
+ if (message && message->callback) {
message->callback(message->session, error, message->user_data);
+ message->callback = NULL;
+ message->user_data = NULL;
+ }
}
static void __send_message_reply(GObject *src, GAsyncResult *res, gpointer user_data)