Add an exception handling about destroying the watcher handle 15/116615/1 accepted/tizen/3.0/common/20170228.061409 accepted/tizen/3.0/ivi/20170228.001447 accepted/tizen/3.0/mobile/20170228.001152 accepted/tizen/3.0/tv/20170228.001256 accepted/tizen/3.0/wearable/20170228.001357 submit/tizen_3.0/20170227.084431
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 27 Feb 2017 08:29:33 +0000 (17:29 +0900)
committerHwanKyu Jhun <h.jhun@samsung.com>
Mon, 27 Feb 2017 08:33:16 +0000 (00:33 -0800)
We should check whether the surface handle is NULL or NOT.

Change-Id: Idca2b162a2e08a68f913118206f655f6336555b7
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
screen_connector_watcher/src/screen_connector_watcher.c

index ad29f4e..1328adf 100644 (file)
@@ -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);