[gtk] wayland: Fix memleak



commit d056be4ea238e6f4371230b1a892ed0100770848
Author: Benjamin Otte <otte redhat com>
Date:   Sun May 6 17:06:57 2018 +0200

    wayland: Fix memleak
    
    7f8a8f221d60bc5da23602e5e024eb91f8b0f758 forgot to free the data offer
    passed to it.

 gdk/wayland/gdkdnd-wayland.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c
index 81ed3505a8..9138e5eb98 100644
--- a/gdk/wayland/gdkdnd-wayland.c
+++ b/gdk/wayland/gdkdnd-wayland.c
@@ -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;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]