summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2005-06-07 15:52:56 +0000
committerRay Strode <halfline@src.gnome.org>2005-06-07 15:52:56 +0000
commit064a86e6203d21ed82a80da37e48925269317d60 (patch)
tree9609ca2d80aa037afc969fa094a92a83ad920e92
parent1ff193b81926c17971788662b8a8e4550c6c5fc3 (diff)
downloadmetacity-064a86e6203d21ed82a80da37e48925269317d60.tar.gz
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.
-rw-r--r--ChangeLog12
-rw-r--r--src/effects.c2
-rw-r--r--src/screen.c13
3 files changed, 22 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index dd1d9fbc..dc2c9f93 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,12 @@
-2005-06-02 Elijah Newren <newren@gmail.com>
+2005-06-07 Ray Strode <rstrode@redhat.com>
+
+ Cleanup font data when done with it (bug 306720).
- * src/window.c (meta_window_configure_request): If a window
- requests to be raised and is denied, set the demands attention
- hint. Fixes #305882.
+ * 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>
diff --git a/src/effects.c b/src/effects.c
index 17f340b1..122387b2 100644
--- a/src/effects.c
+++ b/src/effects.c
@@ -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;
diff --git a/src/screen.c b/src/screen.c
index 75a7bb3c..30b79aad 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -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);