diff options
author | Hwankyu Jhun <h.jhun@samsung.com> | 2017-02-27 17:29:33 +0900 |
---|---|---|
committer | HwanKyu Jhun <h.jhun@samsung.com> | 2017-02-27 00:33:16 -0800 |
commit | 7945614beaa50b35324e2d5d515fc5108d6e9901 (patch) | |
tree | a968b942d85a07c93952b4d14890f8024fc868e1 | |
parent | 1a7a5d000173a1dbefbdfc2b97dd44b4de9a382b (diff) | |
download | screen-connector-7945614beaa50b35324e2d5d515fc5108d6e9901.tar.gz screen-connector-7945614beaa50b35324e2d5d515fc5108d6e9901.tar.bz2 screen-connector-7945614beaa50b35324e2d5d515fc5108d6e9901.zip |
Add an exception handling about destroying the watcher handlesubmit/tizen_3.0/20170227.084431accepted/tizen/3.0/wearable/20170228.001357accepted/tizen/3.0/tv/20170228.001256accepted/tizen/3.0/mobile/20170228.001152accepted/tizen/3.0/ivi/20170228.001447accepted/tizen/3.0/common/20170228.061409
We should check whether the surface handle is NULL or NOT.
Change-Id: Idca2b162a2e08a68f913118206f655f6336555b7
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
-rw-r--r-- | screen_connector_watcher/src/screen_connector_watcher.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/screen_connector_watcher/src/screen_connector_watcher.c b/screen_connector_watcher/src/screen_connector_watcher.c index ad29f4e..1328adf 100644 --- a/screen_connector_watcher/src/screen_connector_watcher.c +++ b/screen_connector_watcher/src/screen_connector_watcher.c @@ -250,10 +250,12 @@ static void __destroy_watcher_h(screen_connector_watcher_h handle) if (!handle) return; - tizen_remote_surface_set_user_data(handle->surface, NULL); - tizen_remote_surface_unredirect(handle->surface); - tizen_remote_surface_destroy(handle->surface); - handle->surface = NULL; + if (handle->surface) { + tizen_remote_surface_set_user_data(handle->surface, NULL); + tizen_remote_surface_unredirect(handle->surface); + tizen_remote_surface_destroy(handle->surface); + handle->surface = NULL; + } if (handle->appid) { free(handle->appid); |