wayland: Fix memleak
authorBenjamin Otte <otte@redhat.com>
Sun, 6 May 2018 15:06:57 +0000 (17:06 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 7 May 2018 14:28:50 +0000 (16:28 +0200)
7f8a8f221d60bc5da23602e5e024eb91f8b0f758 forgot to free the data offer
passed to it.

gdk/wayland/gdkdnd-wayland.c

index 81ed3505a8bbe4c1e4c40925637c2034d03d6e52..9138e5eb98b852141c1f5ef221f3c68a38b40b1c 100644 (file)
@@ -85,7 +85,8 @@ gdk_wayland_drag_context_finalize (GObject *object)
     }
 
   if (wayland_context->data_source)
-    wl_data_source_destroy (wayland_context->data_source);
+  g_clear_pointer (&wayland_context->data_source, (GDestroyNotify) wl_data_source_destroy);
+  g_clear_pointer (&wayland_context->offer, (GDestroyNotify) wl_data_offer_destroy);
 
   dnd_surface = wayland_context->dnd_surface;