summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-10-01 20:01:38 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-10-01 20:01:38 +0200
commit3174bbcdd08a7223f1120f51a6520ef2e8b3b8dc (patch)
tree865381473a365f7f564ef98bd0053b4656fb0b4d
parent7bee0747f5839bad296b9255d4b018250f6af220 (diff)
fixed possible memleak in gtkui
-rw-r--r--plugins/gtkui/gdkdrawing.c13
-rw-r--r--plugins/gtkui/gtkui.c1
2 files changed, 14 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) {
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index 4e35e050..ae7ce4ee 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -1001,6 +1001,7 @@ gtkui_thread (void *ctx) {
trkproperties_destroy ();
progress_destroy ();
gtkui_hide_status_icon ();
+ draw_free ();
gtk_widget_destroy (mainwin);
gtk_widget_destroy (searchwin);
gdk_threads_leave ();