From 2d864846e4ba9d23706c63bf221fecfa45c0c6bd Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Thu, 28 Sep 2023 20:44:15 +0200 Subject: [PATCH] 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 --- source/blender/windowmanager/intern/wm_files.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/blender/windowmanager/intern/wm_files.cc b/source/blender/windowmanager/intern/wm_files.cc index 4bcab90a128..d7714a206c8 100644 --- a/source/blender/windowmanager/intern/wm_files.cc +++ b/source/blender/windowmanager/intern/wm_files.cc @@ -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). */