Cleanup font data when done with it (bug 306720).

2005-06-07  Ray Strode  <rstrode@redhat.com>

	Cleanup font data when done with it (bug 306720).

	* src/effects.c (draw_xor_rect): free font info structure.
	* src/screen.c (meta_screen_new): pass a 1 not a 0 to
	XFreeFontInfo to free font info structure.
	(meta_screen_free): call XUnloadFont on GC font before freeing
	the GC.
This commit is contained in:
Ray Strode 2005-06-07 15:52:56 +00:00 committed by Ray Strode
parent 1ff193b819
commit 064a86e620
3 changed files with 22 additions and 5 deletions

View File

@ -1,8 +1,12 @@
2005-06-02 Elijah Newren <newren@gmail.com>
2005-06-07 Ray Strode <rstrode@redhat.com>
* src/window.c (meta_window_configure_request): If a window
requests to be raised and is denied, set the demands attention
hint. Fixes #305882.
Cleanup font data when done with it (bug 306720).
* src/effects.c (draw_xor_rect): free font info structure.
* src/screen.c (meta_screen_new): pass a 1 not a 0 to
XFreeFontInfo to free font info structure.
(meta_screen_free): call XUnloadFont on GC font before freeing
the GC.
2005-06-02 Elijah Newren <newren@gmail.com>

View File

@ -523,6 +523,8 @@ draw_xor_rect (MetaScreen *screen,
g_free (text);
XFreeFontInfo (NULL, font_struct, 1);
if ((box_width + LINE_WIDTH) >= (rect->width / 3))
return;

View File

@ -563,7 +563,7 @@ meta_screen_new (MetaDisplay *display,
{
gc_values.font = font_info->fid;
value_mask |= GCFont;
XFreeFontInfo (NULL, font_info, 0);
XFreeFontInfo (NULL, font_info, 1);
}
else
meta_warning ("xserver doesn't have 'fixed' font.\n");
@ -671,6 +671,7 @@ void
meta_screen_free (MetaScreen *screen)
{
MetaDisplay *display;
XGCValues gc_values = { 0 };
display = screen->display;
@ -721,6 +722,16 @@ meta_screen_free (MetaScreen *screen)
if (screen->work_area_idle != 0)
g_source_remove (screen->work_area_idle);
if (XGetGCValues (screen->display->xdisplay,
screen->root_xor_gc,
GCFont,
&gc_values))
{
XUnloadFont (screen->display->xdisplay,
gc_values.font);
}
XFreeGC (screen->display->xdisplay,
screen->root_xor_gc);