diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c index 0d2ec7890414d56bcaf07ff14c5c3fccc95ca703..cc68f03403e1a14f1fed37b90fb77dcbb76090ff 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c @@ -404,14 +404,15 @@ xwl_output_remove(struct xwl_output *xwl_output) int width = 0, height = 0; Bool need_rotate = (xwl_output->xdg_output == NULL); - RRCrtcDestroy(xwl_output->randr_crtc); - RROutputDestroy(xwl_output->randr_output); xorg_list_del(&xwl_output->link); xorg_list_for_each_entry(it, &xwl_screen->output_list, link) output_get_new_size(it, need_rotate, &height, &width); update_screen_size(xwl_output, width, height); + RRCrtcDestroy(xwl_output->randr_crtc); + RROutputDestroy(xwl_output->randr_output); + xwl_output_destroy(xwl_output); }