Fix #113002: Fix Crash When Loading Previous Settings

The default theme of blender has no `icon_border_intensity` and
therefore only loads the regular icons. When newly loaded theme has the
`icon_border_intensity` set it needs to reload the icon textures so both
icon maps would be loaded.

Without reloading the icons a GPU texture is missing and would crash
blender at first use. Starting Blender the second time it would load the
correct icons and would work as expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/113016
This commit is contained in:
Jeroen Bakker 2023-09-28 20:44:15 +02:00
parent 31e1a32378
commit 2d864846e4

@ -2452,6 +2452,11 @@ static int wm_userpref_read_exec(bContext *C, wmOperator *op)
U.runtime.is_dirty = true;
}
/* Ensure the correct icon textures are loaded. When the current theme didn't had an
* #icon_border_intensity, but the loaded theme has, the icon with border intensity needs to be
* loaded. */
UI_icons_reload_internal_textures();
BKE_callback_exec_null(bmain, BKE_CB_EVT_EXTENSION_REPOS_UPDATE_POST);
/* Needed to recalculate UI scaling values (eg, #UserDef.inv_dpi_fac). */