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>
commite0087a1347b690d4360dba4455764ac1a778d9c8
parent1bd972e967b527a06a66e8c75a8d7423782fc828
authorBernd Weimer <bernd.weimer@qt.io>
committerBernd Weimer <bernd.weimer@qt.io>
commit timeThu, 22 May 2025 14:21:35 +0100