diff options
author | Pablo Barciela <[email protected]> | 2018-07-25 01:52:55 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-07-30 17:33:51 +0200 |
commit | 06d6e5df6e6631c81ae4d61414108435f0707688 (patch) | |
tree | 5f357a258b0b961f41b78980ad1b061f3f0c74d5 | |
parent | d3757dfa7b822dba1dc1b686ae60fdf77a097cf2 (diff) | |
download | pluma-06d6e5df6e6631c81ae4d61414108435f0707688.tar.bz2 pluma-06d6e5df6e6631c81ae4d61414108435f0707688.tar.xz |
pluma-view: Fix possible memory leak
-rw-r--r-- | pluma/pluma-view.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/pluma/pluma-view.c b/pluma/pluma-view.c index 28b39fe4..d488777e 100644 --- a/pluma/pluma-view.c +++ b/pluma/pluma-view.c @@ -675,7 +675,7 @@ contextmenu_font_changed_cb (GSettings *settings, sys_font_desc = get_system_font (); if (sys_font_desc) { - pluma_override_font (".context-menu", GTK_WIDGET (user_data), sys_font_desc); + pluma_override_font (".context-menu", NULL, sys_font_desc); pango_font_description_free (sys_font_desc); } } @@ -718,10 +718,13 @@ pluma_override_font (const gchar *item, { if (strstr (prov_str, ".context-menu")) { - prov_str = g_strdelimit (prov_str, "}", '\0'); - prov_str = g_strdup_printf ("%s}", prov_str); + g_strdelimit (prov_str, "}", '\0'); + gchar *prov_new_str = g_strdup_printf ("%s}", prov_str); + css = g_strdup_printf ("%s %s { %s %s %s %s }", prov_new_str, item, family, weight, style, size); + g_free (prov_new_str); } - css = g_strdup_printf ("%s %s { %s %s %s %s }", prov_str, item, family, weight, style, size); + else + css = g_strdup_printf ("%s %s { %s %s %s %s }", prov_str, item, family, weight, style, size); } else css = g_strdup_printf ("%s { %s %s %s %s }", item, family, weight, style, size); |