The destructor set on the wl_output resources needs the weston_output
to be allocated, because it removes the resource from its list.
So unset the destructor on all the resources when destroying an
output.
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
WL_EXPORT void
weston_output_destroy(struct weston_output *output)
{
+ struct wl_resource *resource;
+
output->destroying = 1;
weston_compositor_remove_output(output->compositor, output);
pixman_region32_fini(&output->previous_damage);
output->compositor->output_id_pool &= ~(1 << output->id);
+ wl_resource_for_each(resource, &output->resource_list) {
+ wl_resource_set_destructor(resource, NULL);
+ }
+
wl_global_destroy(output->global);
}