patch 9.1.2011: crash when unreferencing gtk icon theme
Commit:
https://github.com/vim/vim/commit/bb10f7140200f319c2b4dd392a63c4acf45ab743
Author: Christian Brabandt <
c...@256bit.org>
Date: Mon Dec 22 18:59:50 2025 +0000
patch 9.1.2011: crash when unreferencing gtk icon theme
Problem: crash when unreferencing gtk icon theme
(noamhalevy-wq, after v9.1.1583)
Solution: Remove the g_object_unref() call.
gtk_icon_theme_get_default() returns a singleton that should NOT be
unreferenced. From GTK documentation:
> A unique GtkIconTheme associated with the default screen. This icon
theme is associated with the screen and can be used as long as the
screen is open. Do not ref or unref it.
fixes: #18997
Signed-off-by: Christian Brabandt <
c...@256bit.org>
diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c
index e588c935d..ec845a36e 100644
--- a/src/gui_gtk_x11.c
+++ b/src/gui_gtk_x11.c
@@ -2750,9 +2750,7 @@ mainwin_realize(GtkWidget *widget UNUSED, gpointer data UNUSED)
icon_theme = gtk_icon_theme_get_default();
if (icon_theme && gtk_icon_theme_has_icon(icon_theme, "gvim"))
- {
gtk_window_set_icon_name(GTK_WINDOW(gui.mainwin), "gvim");
- }
else
{
/*
@@ -2770,7 +2768,6 @@ mainwin_realize(GtkWidget *widget UNUSED, gpointer data UNUSED)
g_list_foreach(icons, (GFunc)(void *)&g_object_unref, NULL);
g_list_free(icons);
}
- g_object_unref(icon_theme);
}
#if !defined(USE_GNOME_SESSION)
diff --git a/src/version.c b/src/version.c
index dd8fdd667..247fc47aa 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2011,
/**/
2010,
/**/