[PATCH weston 2/2] compositor-wayland: Destroy cursor images earlier
Dima Ryazanov
dima at gmail.com
Tue Nov 29 00:10:27 UTC 2016
On Thu, Nov 24, 2016 at 7:32 AM, Daniel Stone <daniels at collabora.com> wrote:
> Destroying a wl_cursor will attempt to access the wl_display, which
> we have just freed. Avoid a segfault by destroying the cursor images
> before we destroy the display.
>
> Signed-off-by: Daniel Stone <daniels at collabora.com>
>
Yep, fixes the crash for me.
Reviewed-by: Dima Ryazanov <dima at gmail.com>
---
> libweston/compositor-wayland.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/libweston/compositor-wayland.c b/libweston/compositor-
> wayland.c
> index d9cbde5..aa69c68 100644
> --- a/libweston/compositor-wayland.c
> +++ b/libweston/compositor-wayland.c
> @@ -2368,10 +2368,6 @@ wayland_destroy(struct weston_compositor *ec)
> if (b->parent.compositor)
> wl_compositor_destroy(b->parent.compositor);
>
> - wl_registry_destroy(b->parent.registry);
> - wl_display_flush(b->parent.wl_display);
> - wl_display_disconnect(b->parent.wl_display);
> -
> if (b->theme)
> theme_destroy(b->theme);
>
> @@ -2380,6 +2376,10 @@ wayland_destroy(struct weston_compositor *ec)
>
> wl_cursor_theme_destroy(b->cursor_theme);
>
> + wl_registry_destroy(b->parent.registry);
> + wl_display_flush(b->parent.wl_display);
> + wl_display_disconnect(b->parent.wl_display);
> +
> free(b);
> }
>
> --
> 2.9.3
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20161128/db24d383/attachment-0001.html>
More information about the wayland-devel
mailing list