diff options
author | 2010-10-01 20:01:38 +0200 | |
---|---|---|
committer | 2010-10-01 20:01:38 +0200 | |
commit | 3174bbcdd08a7223f1120f51a6520ef2e8b3b8dc (patch) | |
tree | 865381473a365f7f564ef98bd0053b4656fb0b4d /plugins/gtkui/gdkdrawing.c | |
parent | 7bee0747f5839bad296b9255d4b018250f6af220 (diff) |
fixed possible memleak in gtkui
Diffstat (limited to 'plugins/gtkui/gdkdrawing.c')
-rw-r--r-- | plugins/gtkui/gdkdrawing.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plugins/gtkui/gdkdrawing.c b/plugins/gtkui/gdkdrawing.c index 27174fa7..c7c2339b 100644 --- a/plugins/gtkui/gdkdrawing.c +++ b/plugins/gtkui/gdkdrawing.c @@ -95,6 +95,19 @@ static GtkStyle *font_style = NULL; static PangoWeight font_weight = PANGO_WEIGHT_NORMAL; void +draw_free (void) { + draw_end (); + if (pangoctx) { + g_object_unref (pangoctx); + pangoctx = NULL; + } + if (pangolayout) { + g_object_unref (pangolayout); + pangolayout = NULL; + } +} + +void draw_init_font (GtkStyle *new_font_style) { if (!pango_ready || (new_font_style && font_style != new_font_style)) { if (pangoctx) { |