Skip to content

Fix Surface Viewport Memory Leak

Daniel Martinez requested to merge Calandracas/weston:fix-viewport-leak into main

valgrind shows that window.c is leaking memory:

==1942== 96 bytes in 1 blocks are definitely lost in loss record 221 of 242
==1942==    at 0x4849A2F: calloc (vg_replace_malloc.c:1675)
==1942==    by 0x4880F13: UnknownInlinedFun (wayland-private.h:234)
==1942==    by 0x4880F13: proxy_create (wayland-client.c:446)
==1942==    by 0x48810A0: UnknownInlinedFun (wayland-client.c:703)
==1942==    by 0x48810A0: wl_proxy_marshal_array_flags (wayland-client.c:870)
==1942==    by 0x4881E34: wl_proxy_marshal_flags (wayland-client.c:823)
==1942==    by 0x1164E8: UnknownInlinedFun (viewporter-client-protocol.h:271)
==1942==    by 0x1164E8: UnknownInlinedFun (window.c:1916)
==1942==    by 0x1164E8: background_configure (desktop-shell.c:891)
==1942==    by 0x5013E6C: ffi_call_unix64 (unix64.S:101)
==1942==    by 0x50132A9: ffi_call_int (ffi64.c:669)
==1942==    by 0x487EA22: wl_closure_invoke.constprop.0 (connection.c:1025)
==1942==    by 0x487F202: dispatch_event.isra.0 (wayland-client.c:1631)
==1942==    by 0x487F493: UnknownInlinedFun (wayland-client.c:1777)
==1942==    by 0x487F493: wl_display_dispatch_queue_pending (wayland-client.c:2019)
==1942==    by 0x1171A8: handle_display_data (window.c:6623)
==1942==    by 0x112846: UnknownInlinedFun (window.c:6912)
==1942==    by 0x112846: main (desktop-shell.c:1596)

This adds a fix to properly destroy the viewport, which fixes the leak

Merge request reports

Loading