wl_shell/compositor surface: do not check if it's in list before removing

This commit is contained in:
Dominique Martinet 2017-08-15 15:27:28 +02:00
parent 5dae8e1be8
commit d49edc8243
2 changed files with 2 additions and 20 deletions

View file

@ -7,17 +7,7 @@
#include "compositor.h"
static void destroy_surface_listener(struct wl_listener *listener, void *data) {
struct wlr_surface *surface = wl_resource_get_user_data(data);
struct wl_compositor_state *state = surface->compositor_data;
assert(data == surface->resource);
struct wl_resource *res = NULL;
wl_list_for_each(res, &state->surfaces, link) {
if (res == surface->resource) {
wl_list_remove(wl_resource_get_link(res));
break;
}
}
wl_list_remove(wl_resource_get_link(data));
}
static void wl_compositor_create_surface(struct wl_client *client,