[PATCH 1/3] Fix wl_data_offer source destroy listener
Kristian Hoegsberg
hoegsberg at gmail.com
Thu Mar 1 08:51:19 PST 2012
On Thu, Mar 01, 2012 at 02:09:41PM +0200, Ander Conselvan de Oliveira wrote:
> The listener function implementation was getting a wrong pointer to the
> wl_data_offer object because the resource parameter is actually the
> data source and not the data offer.
Yeah, oops, good catch.
Kristian
> ---
> src/data-device.c | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/src/data-device.c b/src/data-device.c
> index 645dbc6..0c7fa65 100644
> --- a/src/data-device.c
> +++ b/src/data-device.c
> @@ -80,7 +80,10 @@ static void
> destroy_offer_data_source(struct wl_listener *listener,
> struct wl_resource *resource, uint32_t time)
> {
> - struct wl_data_offer *offer = resource->data;
> + struct wl_data_offer *offer;
> +
> + offer = container_of(listener, struct wl_data_offer,
> + source_destroy_listener);
>
> offer->source = NULL;
> }
> --
> 1.7.4.1
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list