[PATCH] compositor: fix drag segfault

Kristian Høgsberg krh at bitplanet.net
Mon Oct 24 12:52:06 PDT 2011


On Mon, Oct 24, 2011 at 10:34 AM, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> Without this fix, the dnd demo would make the demo compositor crash in
> shell.c:drag_offer() because resource->data is NULL.
>
> Initialise resource->data in shell_create_drag().

Right, thanks.

Kristian

> Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
> ---
>  compositor/shell.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/compositor/shell.c b/compositor/shell.c
> index 05ba7b7..50c80e9 100644
> --- a/compositor/shell.c
> +++ b/compositor/shell.c
> @@ -559,6 +559,7 @@ shell_create_drag(struct wl_client *client,
>        drag->resource.object.implementation =
>                (void (**)(void)) &drag_interface;
>
> +       drag->resource.data = drag;
>        drag->resource.destroy = destroy_drag;
>
>        drag->drag_focus_listener.func = drag_handle_surface_destroy;
> --
> 1.7.3.4
>
>


More information about the wayland-devel mailing list