From 3f50631f17f96ef3695921b892eb2f7b82a2b43d Mon Sep 17 00:00:00 2001
From: Mamoru TASAKA <mtasaka@fedoraproject.org>
Date: Sun, 21 Mar 2021 22:08:16 +0900
Subject: [PATCH 2/2] on_remove_theme_clicked: initialize both variable
correctly
In on_remove_theme_clicked: both variable is used uninitialized, which causes lxappearance segfault
when removing theme. Initialize this correctly.
---
src/icon-theme.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/icon-theme.c b/src/icon-theme.c
index ea1db83..6952cd8 100644
--- a/src/icon-theme.c
+++ b/src/icon-theme.c
@@ -171,7 +171,6 @@ static void on_remove_theme_clicked(GtkButton* btn, gpointer user_data)
if(gtk_tree_selection_get_selected(sel, &model, &it))
{
IconTheme* theme;
- gboolean both = theme->has_icon && theme->has_cursor;
if(gtk_tree_model_iter_n_children(model, NULL) < 2)
{
@@ -183,6 +182,7 @@ static void on_remove_theme_clicked(GtkButton* btn, gpointer user_data)
gtk_tree_model_get(model, &it, 1, &theme, -1);
if(remove_icon_theme(GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(btn))), theme))
{
+ gboolean both = theme->has_icon && theme->has_cursor;
gtk_list_store_remove(GTK_LIST_STORE(model), &it);
/* select the first theme */
--
2.30.2