output: introduce wlr_output_finish()

This commit is contained in:
Kirill Primak 2024-11-22 23:21:08 +03:00 committed by Isaac Freund
parent 7963ba6a0d
commit d5d650f9f6
6 changed files with 22 additions and 7 deletions

View file

@ -375,11 +375,7 @@ void wlr_output_init(struct wlr_output *output, struct wlr_backend *backend,
}
}
void wlr_output_destroy(struct wlr_output *output) {
if (!output) {
return;
}
void wlr_output_finish(struct wlr_output *output) {
wl_signal_emit_mutable(&output->events.destroy, output);
wlr_output_destroy_global(output);
@ -418,10 +414,17 @@ void wlr_output_destroy(struct wlr_output *output) {
free(output->make);
free(output->model);
free(output->serial);
}
void wlr_output_destroy(struct wlr_output *output) {
if (!output) {
return;
}
if (output->impl && output->impl->destroy) {
output->impl->destroy(output);
} else {
wlr_output_finish(output);
free(output);
}
}