compositor: fix memory corruption when removing an output
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>
This commit is contained in:
parent
03faed2074
commit
00535ce6b4
@ -3248,6 +3248,8 @@ weston_compositor_remove_output(struct weston_compositor *compositor,
|
||||
WL_EXPORT void
|
||||
weston_output_destroy(struct weston_output *output)
|
||||
{
|
||||
struct wl_resource *resource;
|
||||
|
||||
output->destroying = 1;
|
||||
|
||||
weston_compositor_remove_output(output->compositor, output);
|
||||
@ -3261,6 +3263,10 @@ weston_output_destroy(struct weston_output *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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user