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>
dev
Alexandros Frantzis 4 years ago committed by Daniel Stone
parent 990173050c
commit fa48c5ee41
  1. 3
      libweston/compositor.c

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

Loading…
Cancel
Save