[PATCH] clients: Free resources on exit in eventdemo

Martin Olsson martin at minimum.se
Sun Jul 8 06:59:44 PDT 2012


On 07/08/2012 03:09 PM, Pekka Paalanen wrote:
> Looks good to me now, I assume you tested this program exits
> properly. Btw. have you tried Valgrind on these?

Yes I tried it; FWIW with the new call to display_destroy the 
eventdemo app now hits invalid read, invalid write and finally an 
assert. However, other clients that do clean up after themselves (like 
clients/resizor) already had this problem, so I believe that's a 
separate bug. Leaks-wise valgrind spams mesa/driver leaks (4M valgrind 
log) in both cases so the only "verification" I got was that the 
static analyzer no longer finds the fixed leak.

==22498== Invalid read of size 4
==22498==    at 0x59361C1: xkb_state_unref (state.c:492)
==22498==    by 0x407F26: display_destroy (window.c:3297)
==22498==    by 0x4048D3: main (eventdemo.c:382)
==22498==  Address 0xa8efe34 is 36 bytes inside a block of size 72 free'd
==22498==    at 0x4C2A82E: free (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22498==    by 0x407EDB: display_destroy (window.c:3342)
==22498==    by 0x4048D3: main (eventdemo.c:382)
==22498==
==22498== Invalid write of size 4
==22498==    at 0x59361CD: xkb_state_unref (state.c:492)
==22498==    by 0x407F26: display_destroy (window.c:3297)
==22498==    by 0x4048D3: main (eventdemo.c:382)
==22498==  Address 0xa8efe34 is 36 bytes inside a block of size 72 free'd
==22498==    at 0x4C2A82E: free (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==22498==    by 0x407EDB: display_destroy (window.c:3342)
==22498==    by 0x4048D3: main (eventdemo.c:382)





More information about the wayland-devel mailing list