Cleaned up the memory leaks in reload_css(gpointer)
1 files changed, 7 insertions(+), 0 deletions(-)

M src/main.c
M src/main.c +7 -0
@@ 157,6 157,13 @@ static gboolean reload_css(gpointer data
 #else
 		gtk_css_provider_load_from_data(css, data, strlen(data), NULL);
 #endif
+		free(data);
+		struct node* tmp;
+		wl_list_for_each_safe(node, tmp, &lines, link) {
+			free(node->line);
+			wl_list_remove(&node->link);
+			free(node);
+		}
 		gtk_style_context_add_provider_for_screen(gdk_screen_get_default(), GTK_STYLE_PROVIDER(css), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
 	}
 	return FALSE;