Skip to content

Commit 06d6e5d

Browse files
sc0wraveit65
authored andcommitted
pluma-view: Fix possible memory leak
1 parent d3757df commit 06d6e5d

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

pluma/pluma-view.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ contextmenu_font_changed_cb (GSettings *settings,
675675
sys_font_desc = get_system_font ();
676676
if (sys_font_desc)
677677
{
678-
pluma_override_font (".context-menu", GTK_WIDGET (user_data), sys_font_desc);
678+
pluma_override_font (".context-menu", NULL, sys_font_desc);
679679
pango_font_description_free (sys_font_desc);
680680
}
681681
}
@@ -718,10 +718,13 @@ pluma_override_font (const gchar *item,
718718
{
719719
if (strstr (prov_str, ".context-menu"))
720720
{
721-
prov_str = g_strdelimit (prov_str, "}", '\0');
722-
prov_str = g_strdup_printf ("%s}", prov_str);
721+
g_strdelimit (prov_str, "}", '\0');
722+
gchar *prov_new_str = g_strdup_printf ("%s}", prov_str);
723+
css = g_strdup_printf ("%s %s { %s %s %s %s }", prov_new_str, item, family, weight, style, size);
724+
g_free (prov_new_str);
723725
}
724-
css = g_strdup_printf ("%s %s { %s %s %s %s }", prov_str, item, family, weight, style, size);
726+
else
727+
css = g_strdup_printf ("%s %s { %s %s %s %s }", prov_str, item, family, weight, style, size);
725728
}
726729
else
727730
css = g_strdup_printf ("%s { %s %s %s %s }", item, family, weight, style, size);

0 commit comments

Comments
 (0)