]> Pileus Git - ~andy/gtk/commitdiff
Bug 554076 – eventually release g_new-ed supported_atoms
authorChristian Dywan <christian@imendio.com>
Sun, 30 Nov 2008 05:28:28 +0000 (05:28 +0000)
committerChristian Dywan <cdywan@src.gnome.org>
Sun, 30 Nov 2008 05:28:28 +0000 (05:28 +0000)
2008-11-30  Christian Dywan  <christian@imendio.com>

Bug 554076 – eventually release g_new-ed supported_atoms

* gdk/x11/gdkevents-x11.c (cleanup_atoms),
(gdk_x11_screen_supports_net_wm_hint): Set cleanup callback.
        Patch by Caolan McNamara.

svn path=/trunk/; revision=21833

ChangeLog
gdk/x11/gdkevents-x11.c

index 5cae3f25900ee97294d1f29e1cba5d30cc0d77bf..b105c177690dfb346f476a644718d7faafbe22a1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-11-30  Christian Dywan  <christian@imendio.com>
+
+       Bug 554076 – eventually release g_new-ed supported_atoms
+
+       * gdk/x11/gdkevents-x11.c (cleanup_atoms),
+       (gdk_x11_screen_supports_net_wm_hint): Set cleanup callback.
+        Patch by Caolan McNamara.
+
 2008-11-30  Christian Dywan  <christian@imendio.com>
 
        Bug 539263 – Deprecate gdk_window_get_toplevels
index 223697541a5748b682fd8f3dd9a3dc024c34d3c0..2cd817b23858be83c4dc12f383777d148cd795d7 100644 (file)
@@ -2742,6 +2742,15 @@ struct _NetWmSupportedAtoms
   gulong n_atoms;
 };
 
+static void
+cleanup_atoms(gpointer data)
+{
+  NetWmSupportedAtoms *supported_atoms = data;
+  if (supported_atoms->atoms)
+      XFree (supported_atoms->atoms);
+  g_free (supported_atoms);
+}
+
 /**
  * gdk_x11_screen_supports_net_wm_hint:
  * @screen: the relevant #GdkScreen.
@@ -2787,7 +2796,7 @@ gdk_x11_screen_supports_net_wm_hint (GdkScreen *screen,
   if (!supported_atoms)
     {
       supported_atoms = g_new0 (NetWmSupportedAtoms, 1);
-      g_object_set_data (G_OBJECT (screen), "gdk-net-wm-supported-atoms", supported_atoms);
+      g_object_set_data_full (G_OBJECT (screen), "gdk-net-wm-supported-atoms", supported_atoms, cleanup_atoms);
     }
 
   fetch_net_wm_check_window (screen);