summaryrefslogtreecommitdiffstats
path: root/apps/gui/skin_engine/skin_engine.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2011-09-15 13:48:17 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2011-09-15 13:48:17 +0000
commit81343bae5d377f9ebb7fbc15d87f7f7d782179e8 (patch)
treeb0e698ead50b63a0b6625d377abad6cd9d0c0b90 /apps/gui/skin_engine/skin_engine.c
parent0cfd7a388874f3a95662bcd349bd371d497e59f3 (diff)
downloadrockbox-81343bae5d377f9ebb7fbc15d87f7f7d782179e8.tar.gz
rockbox-81343bae5d377f9ebb7fbc15d87f7f7d782179e8.zip
skin_engine: make sure to free all buflib allocations so we dont leak handles/memory
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30554 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/skin_engine/skin_engine.c')
-rw-r--r--apps/gui/skin_engine/skin_engine.c63
1 files changed, 35 insertions, 28 deletions
diff --git a/apps/gui/skin_engine/skin_engine.c b/apps/gui/skin_engine/skin_engine.c
index 8e85cb891f..7a9a10ec57 100644
--- a/apps/gui/skin_engine/skin_engine.c
+++ b/apps/gui/skin_engine/skin_engine.c
@@ -55,34 +55,7 @@ void theme_init_buffer(void)
}
#endif
-void settings_apply_skins(void)
-{
- int i, j;
- skin_buffer_init(skin_buffer, SKIN_BUFFER_SIZE);
-
-#ifdef HAVE_LCD_BITMAP
- skin_backdrop_init();
- skin_font_init();
-#endif
- gui_sync_skin_init();
-
- /* Make sure each skin is loaded */
- for (i=0; i<SKINNABLE_SCREENS_COUNT; i++)
- {
- FOR_NB_SCREENS(j)
- skin_get_gwps(i, j);
- }
-#if LCD_DEPTH > 1 || defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
- skin_backdrops_preload(); /* should maybe check the retval here... */
-#endif
- viewportmanager_theme_changed(THEME_STATUSBAR);
-#if LCD_DEPTH > 1 || defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
- FOR_NB_SCREENS(i)
- skin_backdrop_show(sb_get_backdrop(i));
-#endif
-}
-
-
+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);
@@ -130,6 +103,40 @@ void gui_sync_skin_init(void)
}
}
+void settings_apply_skins(void)
+{
+ int i, j;
+
+ for (i=0; i<SKINNABLE_SCREENS_COUNT; i++)
+ {
+ FOR_NB_SCREENS(j)
+ skin_data_free_buflib_allocs(&skins[j][i].data);
+ }
+
+ skin_buffer_init(skin_buffer, SKIN_BUFFER_SIZE);
+
+#ifdef HAVE_LCD_BITMAP
+ skin_backdrop_init();
+ skin_font_init();
+#endif
+ gui_sync_skin_init();
+
+ /* Make sure each skin is loaded */
+ for (i=0; i<SKINNABLE_SCREENS_COUNT; i++)
+ {
+ FOR_NB_SCREENS(j)
+ skin_get_gwps(i, j);
+ }
+#if LCD_DEPTH > 1 || defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
+ skin_backdrops_preload(); /* should maybe check the retval here... */
+#endif
+ viewportmanager_theme_changed(THEME_STATUSBAR);
+#if LCD_DEPTH > 1 || defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1
+ FOR_NB_SCREENS(i)
+ skin_backdrop_show(sb_get_backdrop(i));
+#endif
+}
+
void skin_load(enum skinnable_screens skin, enum screen_type screen,
const char *buf, bool isfile)
{