st/icon-theme: Disconnect from settings signals on disposal

Icon themes can be created by extensions and thus are likely destroyed on
extension unload, so we must disconnect from StSettings signals to avoid
accessing to invalid memory.

See: https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/2012021
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2711>
This commit is contained in:
Marco Trevisan (Treviño) 2023-03-20 21:23:36 +01:00 committed by Marge Bot
parent 95386a1423
commit 69e7b8e79a

View File

@ -478,8 +478,8 @@ st_icon_theme_init (StIconTheme *icon_theme)
icon_theme->pixbuf_supports_svg = pixbuf_supports_svg ();
settings = st_settings_get ();
g_signal_connect (settings, "notify::gtk-icon-theme",
G_CALLBACK (theme_changed), icon_theme);
g_signal_connect_object (settings, "notify::gtk-icon-theme",
G_CALLBACK (theme_changed), icon_theme, 0);
update_current_theme (icon_theme);
}