compositor: set weston_surface:resource to NULL when destroyed
with the previous patch the resource isn't used inside weston_surface_destroy() anymore (aside sending events unuseful for a closing client), so we can safely reset it. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Bryce Harrington <b.harrington@samsung.com>
This commit is contained in:
parent
b9eae3369b
commit
0d379744d3
@ -1338,6 +1338,10 @@ destroy_surface(struct wl_resource *resource)
|
||||
{
|
||||
struct weston_surface *surface = wl_resource_get_user_data(resource);
|
||||
|
||||
/* Set the resource to NULL, since we don't want to leave a
|
||||
* dangling pointer if the surface was refcounted and survives
|
||||
* the weston_surface_destroy() call. */
|
||||
surface->resource = NULL;
|
||||
weston_surface_destroy(surface);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user