Do not font_unload() failed fonts when aborting a skin load

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30714 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Fred Bauer 2011-10-05 04:19:00 +00:00
parent 2e58d5935d
commit b683874e98

View file

@ -1706,7 +1706,10 @@ static bool skin_load_fonts(struct wps_data *data)
if (!success || data->font_ids == NULL) if (!success || data->font_ids == NULL)
{ {
while (font_count > 0) while (font_count > 0)
font_unload(id_array[--font_count]); {
if(id_array[--font_count] != -1)
font_unload(id_array[font_count]);
}
data->font_ids = NULL; data->font_ids = NULL;
return false; return false;
} }