On Tue Jul 4 19:02:44 2023 +0000, Rémi Bernon wrote:
This is also a bit unusual, I'd rather do:
if (wws->wayland_surface->latest_window_buffer) wayland_shm_buffer_unref(wws->wayland_surface->latest_window_buffer); wayland_shm_buffer_ref((wws->wayland_surface->latest_window_buffer = shm_buffer));
Or on separate lines if you prefer, but adding the ref count just next to the assignment.
I guess this was maybe supposed to cover the case when `last == shm_buffer`, but as with the changes I suggested above you would still own a reference over then entire function it should be fine.