e-pixmap/e-comp-wl: fixed the problem for multiple callbacks 39/51739/4
authorMinJeong Kim <minjjj.kim@samsung.com>
Fri, 13 Nov 2015 09:43:49 +0000 (18:43 +0900)
committerMinJeong Kim <minjjj.kim@samsung.com>
Fri, 13 Nov 2015 10:14:32 +0000 (19:14 +0900)
 The wayland client requests destroy of callback after recieved a callback
done event from enlightenment, and enlightenment removes the callback
resource from its managed list as response of the destroy request.

 So if there are multiple frame callbacks, the loop for sending frame done
event of those multiple frame callbacks is stopped by removal of target
node(target callback resource) by the destroy request of first callback
resource.

For resolve these problem, we have to use EINA_LIST_FOREACH_SAFE instead of
EINA_LIST_FREE to keep up works with the callback list.

@fix
Change-Id: I2722ecb80855eea680f2abb80aed3d64413a0a69

src/bin/e_comp_wl.c
src/bin/e_pixmap.c

index 2759f5c5fb5aefbc5d2442b3290344fa58e8a9f3..f86cbe21f37da8bdf1dd207639cf068efe9a3458 100644 (file)
@@ -1990,6 +1990,8 @@ _e_comp_wl_frame_cb_destroy(struct wl_resource *resource)
 
    ec->comp_data->pending.frames =
      eina_list_remove(ec->comp_data->pending.frames, resource);
+
+   wl_resource_destroy(resource);
 }
 
 static void
index 703b2df956c2284f41d05e93d96fbecf5f59287a..d38c536bae6ed428388d421728488ee38e08d2b7 100644 (file)
@@ -845,14 +845,12 @@ e_pixmap_image_clear(E_Pixmap *cp, Eina_Bool cache)
           {
              E_Comp_Wl_Client_Data *cd;
              struct wl_resource *cb;
+             Eina_List *l, *ll;
 
              if ((!cp->client) || (!cp->client->comp_data)) return;
              cd = (E_Comp_Wl_Client_Data *)cp->client->comp_data;
-             EINA_LIST_FREE(cd->frames, cb)
-               {
-                  wl_callback_send_done(cb, ecore_time_unix_get());
-                  wl_resource_destroy(cb);
-               }
+             EINA_LIST_FOREACH_SAFE(cd->frames, l, ll, cb)
+                wl_callback_send_done(cb, ecore_time_unix_get());
           }
 #endif
         break;