redo r27027 to hopefully fix data aborts when loading a theme
authorjdgordon <jdgordon@a1c6a512-1295-4272-9138-f99709370657>
Wed, 23 Jun 2010 02:03:51 +0000 (23 02:03 +0000)
committerjdgordon <jdgordon@a1c6a512-1295-4272-9138-f99709370657>
Wed, 23 Jun 2010 02:03:51 +0000 (23 02:03 +0000)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27071 a1c6a512-1295-4272-9138-f99709370657

firmware/font.c

index b4cead7..c5348d5 100644 (file)
@@ -453,7 +453,10 @@ void font_unload(int font_id)
     {
         if (pf->fd >= 0)
             close(pf->fd);
-        sysfonts[font_id] = NULL;
+        if (font_id == FONT_UI)
+            font_reset(pf);
+        else if (font_id >= SYSTEMFONTCOUNT)
+            sysfonts[font_id] = NULL;
     }
 }