Skip to content

Commit

Permalink
gui/css: fix a memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
LBCrion committed Feb 19, 2025
1 parent d932334 commit 1ff417a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/gui/css.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,18 @@ static void (*css_style_updated_original)(GtkWidget *);
void css_file_load ( gchar *name )
{
GtkCssProvider *css;
gchar *fname, *css_string;
gchar *fname, *css_input, *css_string;

if(!name)
return;

fname = get_xdg_config_file(name, NULL);
if(!fname)
return;
if(g_file_get_contents(fname, &css_string, NULL, NULL))
if(g_file_get_contents(fname, &css_input, NULL, NULL))
{
css_string = css_legacy_preprocess(css_string);
css_string = css_legacy_preprocess(css_input);
g_free(css_input);
css = gtk_css_provider_new();
gtk_css_provider_load_from_data(css, css_string, strlen(css_string), NULL);
gtk_style_context_add_provider_for_screen(gdk_screen_get_default(),
Expand Down

0 comments on commit 1ff417a

Please sign in to comment.