Bug 554076 – eventually release g_new-ed supported_atoms

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
This commit is contained in:
Christian Dywan 2008-11-30 05:28:28 +00:00 committed by Christian Dywan
parent 2dea920895
commit e0ce091631
2 changed files with 18 additions and 1 deletions

View File

@ -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

View 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);