[PATCH 1/3] Fix wl_data_offer source destroy listener

Ander Conselvan de Oliveira ander.conselvan.de.oliveira at intel.com
Thu Mar 1 04:09:41 PST 2012


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.
---
 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



More information about the wayland-devel mailing list