[Bugfix] #FS13567 5+ fonts WPS file causes next theme loaded to fail

Investigating this issue I found that when
SBS and WPS share the same fonts the refcount prevents
the soon to be unused font from unloading
by the time the fnt is unloaded its already too late because the WPS
load failed.

What appears to work is freeing the fonts used by the skin items ahead
of time via skin_reset_buffers() in a separate loop instead of in the
loop used to load the skin files

Change-Id: Ib118163185d48b67b7c96e436bfb6fab8db546a9
This commit is contained in:
William Wilgus 2025-03-02 14:41:06 -05:00
parent dad8f163c3
commit 81c65536ec

View file

@ -179,6 +179,16 @@ void settings_apply_skins(void)
audio_stop();
bool first_run = skin_backdrop_init();
if (!first_run)
{
/* Make sure all skins unloaded */
for (i=0; i<SKINNABLE_SCREENS_COUNT; i++)
{
FOR_NB_SCREENS(j)
skin_reset_buffers(i, j);
}
}
skins_initialised = true;
/* Make sure each skin is loaded */
@ -187,11 +197,6 @@ void settings_apply_skins(void)
FOR_NB_SCREENS(j)
{
get_skin_filename(filename, MAX_PATH, i,j);
if (!first_run)
{
skin_reset_buffers(i, j);
}
gui_skin_reset(&skins[i][j]);
skins[i][j].gui_wps.display = &screens[j];
if (skin_helpers[i]->load_on_boot)