]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.2011: crash when unreferencing gtk icon theme v9.1.2011
authorChristian Brabandt <cb@256bit.org>
Mon, 22 Dec 2025 18:59:50 +0000 (18:59 +0000)
committerChristian Brabandt <cb@256bit.org>
Mon, 22 Dec 2025 18:59:50 +0000 (18:59 +0000)
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 <cb@256bit.org>
src/gui_gtk_x11.c
src/version.c

index e588c935d4568b982c757d428a8c4600e82cd254..ec845a36e6af65364f22cd78e7b9c17b747ed097 100644 (file)
@@ -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)
index dd8fdd6672848200a4bac9a977b6e68f3df868d2..247fc47aa5862952c9a761319046cf56d2f26caf 100644 (file)
@@ -734,6 +734,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2011,
 /**/
     2010,
 /**/