Clear buffer reference when toolkit removed 95/143395/1
authorHyunho Kang <hhstark.kang@samsung.com>
Wed, 9 Aug 2017 13:21:58 +0000 (22:21 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Wed, 9 Aug 2017 13:23:45 +0000 (22:23 +0900)
When provider died referenced remote surface buffer should be released

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

index ed3e337..164b4f5 100644 (file)
@@ -165,7 +165,9 @@ static void __clear_img_file(screen_connector_toolkit_evas_h toolkit_evas_h)
 static void __destroy_toolkit_evas_h(gpointer data)
 {
        char *plug_id;
+       cur_buffer_info_h c_buf_info;
        screen_connector_toolkit_evas_h toolkit_evas_h = data;
+       struct tizen_remote_surface *surface;
 
        if (!toolkit_evas_h)
                return;
@@ -206,6 +208,14 @@ static void __destroy_toolkit_evas_h(gpointer data)
                                EVAS_CALLBACK_MOVE,
                                __obj_update_visibility);
 
+               c_buf_info = g_hash_table_lookup(__cur_buffer_table,
+                               toolkit_evas_h->cur_buffer);
+               if (c_buf_info != NULL) {
+                       surface = screen_connector_toolkit_get_trs(
+                                               toolkit_evas_h->toolkit_h);
+                       __cur_buffer_info_unref(surface, c_buf_info);
+               }
+
                plug_id = evas_object_data_del(toolkit_evas_h->img_tbm, "___PLUGID");
                if (plug_id)
                        free(plug_id);