diff options
author | 문선아/Tizen Platform Lab(SR)/Engineer/삼성전자 <seonah1.moon@samsung.com> | 2020-04-07 16:58:35 +0900 |
---|---|---|
committer | GitHub Enterprise <noreply-CODE@samsung.com> | 2020-04-07 16:58:35 +0900 |
commit | 6c3f570f612736f0fc3fae549583ed2721876e86 (patch) | |
tree | 3f7941ba447756b0d1d037019883d050a969ee99 /src | |
parent | 08ea74988aad7e409e9afee5ee60eadf66525d4f (diff) | |
parent | f56190a6b8b43009658728b1a1e8a48a0a290a9a (diff) | |
download | wifi-aware-6c3f570f612736f0fc3fae549583ed2721876e86.tar.gz wifi-aware-6c3f570f612736f0fc3fae549583ed2721876e86.tar.bz2 wifi-aware-6c3f570f612736f0fc3fae549583ed2721876e86.zip |
Merge pull request #103 from seonah1-moon/master
Prevent segmentation fault when invoking callback function
Diffstat (limited to 'src')
-rw-r--r-- | src/wifi-aware-data-path.c | 3 | ||||
-rw-r--r-- | src/wifi-aware-private.c | 9 |
2 files changed, 8 insertions, 4 deletions
diff --git a/src/wifi-aware-data-path.c b/src/wifi-aware-data-path.c index 9a953c7..949f9aa 100644 --- a/src/wifi-aware-data-path.c +++ b/src/wifi-aware-data-path.c @@ -216,9 +216,10 @@ static void __data_path_invoke_callback(wifi_aware_data_path_h data_path, wifi_a wifi_aware_data_path_s *ndp = (wifi_aware_data_path_s *)data_path; if (ndp->open_cb) { - ndp->open_cb(data_path, error, ndp->open_cb_user_data); + wifi_aware_data_path_open_cb open_cb = ndp->open_cb; ndp->open_cb = NULL; ndp->open_cb_user_data = NULL; + open_cb(data_path, error, ndp->open_cb_user_data); } } diff --git a/src/wifi-aware-private.c b/src/wifi-aware-private.c index 7f74b46..727ba98 100644 --- a/src/wifi-aware-private.c +++ b/src/wifi-aware-private.c @@ -239,9 +239,10 @@ static void __enable_request_reply(GObject *src, GAsyncResult *res, gpointer use } if (g_wifi_aware->enabled_cb) { - g_wifi_aware->enabled_cb(error, g_wifi_aware->enabled_cb_data); + wifi_aware_enabled_cb enabled_cb = g_wifi_aware->enabled_cb; g_wifi_aware->enabled_cb = NULL; g_wifi_aware->enabled_cb_data = NULL; + enabled_cb(error, g_wifi_aware->enabled_cb_data); } } @@ -272,9 +273,10 @@ static void __wifi_aware_publish_invoke_callback(wifi_aware_session_h session, wifi_aware_session_s *handle = (wifi_aware_session_s *)session; if (handle->published_cb) { - handle->published_cb(session, error, handle->published_cb_data); + wifi_aware_published_cb published_cb = handle->published_cb; handle->published_cb = NULL; handle->published_cb_data = NULL; + published_cb(session, error, handle->published_cb_data); } } @@ -370,9 +372,10 @@ static void __wifi_aware_subscribe_invoke_callback(wifi_aware_session_h session, wifi_aware_session_s *handle = (wifi_aware_session_s *)session; if (handle->subscribed_cb) { - handle->subscribed_cb(session, error, handle->subscribed_cb_data); + wifi_aware_subscribed_cb subscribed_cb = handle->subscribed_cb; handle->subscribed_cb = NULL; handle->subscribed_cb_data = NULL; + subscribed_cb(session, error, handle->subscribed_cb_data); } } |