Clean up buffers on destroy requests immediately
This is about the linux_dmabuf client buffer management. On the server,
buffer representations (LinuxDmabufClientBuffer/LinuxDmabufWlBuffer)
are only deleted when a client disconnects. They are not deleted upon
buffer destroy requests from the client. Hence, some unused memory
piles up for each deleted buffer.
We call wl_resource_destroy now in the destroy request handler (like
other compositors do). The basic idea is that LinuxDmabufClientBuffer
own's the LinuxDmabufWlBuffer now. So, instead of relying on the
destroy callback function of LinuxDmabufWlBuffer, the
LinuxDmabufClientBuffer's BufferManager destroy listener will delete
the buffer representations.
Also removed futile code.
Fixes: QTBUG-132208
Change-Id: Ib48404623d1aa9984434ed238395709b08dc0574
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Thomas Senyk <thomas.senyk@qt.io>