aboutsummaryrefslogtreecommitdiffstats
path: root/tests/cpp-compile-test.cpp
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2018-04-16 15:00:59 -0500
committerDerek Foreman <derekf@osg.samsung.com>2018-04-20 13:19:13 -0500
commit5e0f7ad1bfcaadcc9cfaa1bd3fa78a1442b873a2 (patch)
tree939211c4f95ce27cd2261a3e61bc179f105ab3fb /tests/cpp-compile-test.cpp
parenttests: Test for use after free in resource destruction signals (diff)
downloadwayland-5e0f7ad1bfcaadcc9cfaa1bd3fa78a1442b873a2.tar
wayland-5e0f7ad1bfcaadcc9cfaa1bd3fa78a1442b873a2.tar.gz
wayland-5e0f7ad1bfcaadcc9cfaa1bd3fa78a1442b873a2.tar.bz2
wayland-5e0f7ad1bfcaadcc9cfaa1bd3fa78a1442b873a2.tar.lz
wayland-5e0f7ad1bfcaadcc9cfaa1bd3fa78a1442b873a2.tar.xz
wayland-5e0f7ad1bfcaadcc9cfaa1bd3fa78a1442b873a2.tar.zst
wayland-5e0f7ad1bfcaadcc9cfaa1bd3fa78a1442b873a2.zip
server: Add special case destroy signal emitter
In the past much code (weston, efl/enlightenment, mutter) has freed structures containing wl_listeners from destroy handlers without first removing the listener from the signal. As the destroy notifier only fires once, this has largely gone unnoticed until recently. Other code does not (Qt, wlroots) - and removes itself from the signal before free. If somehow a destroy signal is listened to by code from both kinds of callers, those that free will corrupt the lists for those that don't, and Bad Things will happen. To avoid these bad things, remove every item from the signal list during destroy emit, and put it in a list all its own. This way whether the listener is removed or not has no impact on the following emits. Signed-off-by: Derek Foreman <derekf@osg.samsung.com> Reviewed-by: Simon Ser <contact@emersion.fr> Reviewed-by: Markus Ongyerth <wl@ongy.net>
Diffstat (limited to 'tests/cpp-compile-test.cpp')
0 files changed, 0 insertions, 0 deletions