[gtk+/gtk-3-22] GDK W32: Don't leak the atom name string



commit 41026987be0e00b8a1fda7fb2b9b444de297df5b
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 da5f2cf..5503a84 100644
--- a/gdk/win32/gdkdisplay-win32.c
+++ b/gdk/win32/gdkdisplay-win32.c
@@ -686,10 +686,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)
@@ -709,6 +710,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]