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,
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,
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,
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)
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)