Unref buffer before bind surface 27/144227/1 accepted/tizen/3.0/common/20170816.145251 accepted/tizen/3.0/ivi/20170816.131303 accepted/tizen/3.0/mobile/20170816.131242 accepted/tizen/3.0/tv/20170816.131315 accepted/tizen/3.0/wearable/20170816.131327 submit/tizen_3.0/20170816.055230
authorHyunho Kang <hhstark.kang@samsung.com>
Wed, 16 Aug 2017 03:04:34 +0000 (12:04 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Wed, 16 Aug 2017 03:09:12 +0000 (12:09 +0900)
Buffer should be released before bind, if not watch window can not use one
buffer which referenced by watch application

Change-Id: I780e709776366e8a40a083c3c7fd08451cb4983e
Signed-off-by: Hyunho Kang <hhstark.kang@samsung.com>
screen_connector_watcher_evas/src/screen_connector_toolkit_evas.c

index 9ce2c63..fdf095b 100644 (file)
@@ -1283,6 +1283,7 @@ EXPORT_API int screen_connector_toolkit_evas_bind(screen_connector_toolkit_evas_
        Ecore_Wl_Window *wl_win;
        viewer_visibility_h visibility_h;
        struct tizen_remote_surface *trs;
+       cur_buffer_info_h c_buf_info;
 
        if (!h)
                return -1;
@@ -1313,6 +1314,17 @@ EXPORT_API int screen_connector_toolkit_evas_bind(screen_connector_toolkit_evas_
        trs = screen_connector_toolkit_get_trs(h->toolkit_h);
        if (trs)
                tizen_remote_surface_transfer_touch_cancel(trs);
+
+       if (h->cur_buffer) {
+               if (tizen_remote_surface_get_version(trs)
+                               >= TIZEN_REMOTE_SURFACE_RELEASE_SINCE_VERSION) {
+                       c_buf_info = g_hash_table_lookup(
+                                       __cur_buffer_table, h->cur_buffer);
+                       if (c_buf_info != NULL)
+                               __cur_buffer_info_unref(trs, c_buf_info);
+               }
+       }
+
        return screen_connector_toolkit_bind(h->toolkit_h, surface);
 }