To manage unmapping of shm buffer pool only inside of wayland-shm
implementation is totally unsafe because there are some cases that the wayland
display server handles data of some shm buffer after destroying of a wayland
client which wass wrtier of the shm buffer. So ref/unref APIs of wl_shm_pool
are necessary to use buffer without risk.
Change-Id: I7ae9251a9755ebad97afb8d6fd8e2d7f05fa9a22
E_Comp_Wl_Buffer_Ref buffer_ref;
struct wl_listener buffer_destroy_listener;
void *data;
+ struct wl_shm_pool *data_pool;
Eina_Rectangle opaque;
uuid_t uuid;
E_FREE(cp->cdata);
cp->own_cdata = EINA_FALSE;
}
+ if (cp->data_pool)
+ {
+ wl_shm_pool_unref(cp->data_pool);
+ cp->data_pool = NULL;
+ }
_e_pixmap_clear(cp, 1);
ELOG("PIXMAP FREE", cp, cp->client);
free(cp);
}
cp->data = wl_shm_buffer_get_data(shm_buffer);
+
+ if (cp->data_pool) wl_shm_pool_unref(cp->data_pool);
+ cp->data_pool = wl_shm_buffer_ref_pool(shm_buffer);
}
else if (buffer->type == E_COMP_WL_BUFFER_TYPE_NATIVE)
{