output.c: remove unnecessary _remove() and _destroy()

This commit is contained in:
Johan Malm 2021-02-15 18:36:30 +00:00
parent 0e69c9ee9f
commit f3a95d65ad

View file

@ -755,38 +755,20 @@ output_damage_frame_notify(struct wl_listener *listener, void *data)
send_frame_done(output, &frame_data);
}
static void
output_destroy(struct output *output)
{
if (!output || output->server->output_layout || !output->wlr_output) {
return;
}
wl_list_remove(&output->link);
wl_list_remove(&output->destroy.link);
wl_list_remove(&output->damage_frame.link);
wl_list_remove(&output->damage_destroy.link);
struct server *server = output->server;
wlr_output_layout_remove(server->output_layout, output->wlr_output);
free(output);
}
static void
output_damage_destroy_notify(struct wl_listener *listener, void *data)
{
struct output *output = wl_container_of(listener, output, damage_destroy);
output_destroy(output);
wl_list_remove(&output->damage_frame.link);
wl_list_remove(&output->damage_destroy.link);
}
static void
output_destroy_notify(struct wl_listener *listener, void *data)
{
struct output *output = wl_container_of(listener, output, destroy);
if (!output || !output->wlr_output || !output->damage) {
return;
}
wlr_output_damage_destroy(output->damage);
output_destroy(output);
wl_list_remove(&output->link);
wl_list_remove(&output->destroy.link);
}
static void