[gtk+] GDK W32: Don't leak the atom name string



commit 3237c2172a51003f936fa07816a5d03581b48f2c
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date:   Tue Aug 22 14:23:14 2017 +0000

    GDK W32: Don't leak the atom name string
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786509

 gdk/win32/gdkdisplay-win32.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c
index 4441308..61d8535 100644
--- a/gdk/win32/gdkdisplay-win32.c
+++ b/gdk/win32/gdkdisplay-win32.c
@@ -677,10 +677,11 @@ gdk_win32_display_request_selection_notification (GdkDisplay *display,
 {
   GdkWin32Display *display_win32 = GDK_WIN32_DISPLAY (display);
   gboolean ret = FALSE;
+  gchar *selection_name = gdk_atom_name (selection);
 
   GDK_NOTE (DND,
             g_print ("gdk_display_request_selection_notification (..., %s)",
-                     gdk_atom_name (selection)));
+                     selection_name));
 
   if (selection == GDK_SELECTION_CLIPBOARD ||
       selection == GDK_SELECTION_PRIMARY)
@@ -700,6 +701,8 @@ gdk_win32_display_request_selection_notification (GdkDisplay *display,
       ret = FALSE;
     }
 
+  g_free (selection_name);
+
   GDK_NOTE (DND, g_print (" -> %s\n", ret ? "TRUE" : "FALSE"));
   return ret;
 }


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