On Fri, 5 Feb 2016 08:23:53 +0900
nic...@nicesj.com wrote:

> Dear all,
> 
> I can learn many things from this mailing list, thank you very much.
> 
> I have one more doubt about relations between memory pool and buffer.
> 
> I read a doc of wayland and it explains a wl_buffer can be created from 
> shm-pool.
> 
> but in the example code, after creates the buffer from pool, attach
> it to the surface, and then the example destroyes shm pool resources
> from the client side.
> 
> so the server will gets destroy request.
> 
> the buffer which is attached to surface, however, still in use.
> 
> If I understood correctly, the pool should not be destroyed until all
> wl-buffers are freed.
> 
> Am I understood correctly?
> 
> or does the server should keep the pool information even though the
> client destroyes it?

Hi,

all wl_shm-based wl_buffer objects keep a reference to the underlying
memory in compositors. Only after both the wl_shm_pool and all
wl_buffers created from it are destroyed, will the compositor free the
underlying memory.

See the documentation of wl_shm_pool::create_buffer
http://wayland.freedesktop.org/docs/html/apa.html#protocol-spec-wl_shm_pool


Thanks,
pq

Attachment: pgp7nqN070jvT.pgp
Description: OpenPGP digital signature

_______________________________________________
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to