libweston: Use weston_signal_emit_mutable for surface destruction

This avoids crashes due to removal of notification listeners from within
invocations of other listener callbacks in the same signal emission.

Fixes: #415

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
This commit is contained in:
Alexandros Frantzis 2020-07-09 17:31:34 +03:00 committed by Daniel Stone
parent 990173050c
commit fa48c5ee41

View File

@ -68,6 +68,7 @@
#include "shared/os-compatibility.h"
#include "shared/string-helpers.h"
#include "shared/timespec-util.h"
#include "shared/signal.h"
#include "git-version.h"
#include <libweston/version.h>
#include <libweston/plugin-registry.h>
@ -2308,7 +2309,7 @@ weston_surface_destroy(struct weston_surface *surface)
assert(surface->resource == NULL);
wl_signal_emit(&surface->destroy_signal, surface);
weston_signal_emit_mutable(&surface->destroy_signal, surface);
assert(wl_list_empty(&surface->subsurface_list_pending));
assert(wl_list_empty(&surface->subsurface_list));