Fix FS#12408 - don't load skins too early causing buflib handles to leak

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31080 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2011-11-28 10:44:16 +00:00
parent e5a7388fc7
commit 25bce232f2

View file

@ -43,6 +43,7 @@
void skin_data_free_buflib_allocs(struct wps_data *wps_data);
char* wps_default_skin(enum screen_type screen);
char* default_radio_skin(enum screen_type screen);
static bool skins_initialised = false;
static char* get_skin_filename(char *buf, size_t buf_size,
enum skinnable_screens skin, enum screen_type screen);
@ -131,6 +132,8 @@ void settings_apply_skins(void)
#ifdef HAVE_LCD_BITMAP
skin_backdrop_init();
#endif
skins_initialised = true;
/* Make sure each skin is loaded */
for (i=0; i<SKINNABLE_SCREENS_COUNT; i++)
{
@ -265,6 +268,9 @@ static char* get_skin_filename(char *buf, size_t buf_size,
struct gui_wps *skin_get_gwps(enum skinnable_screens skin, enum screen_type screen)
{
if (skin == CUSTOM_STATUSBAR && !skins_initialised)
return &skins[skin][screen].gui_wps;
if (skins[skin][screen].data.wps_loaded == false)
{
char filename[MAX_PATH];