diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2011-09-15 13:48:17 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2011-09-15 13:48:17 +0000 |
| commit | 81343bae5d377f9ebb7fbc15d87f7f7d782179e8 (patch) | |
| tree | b0e698ead50b63a0b6625d377abad6cd9d0c0b90 /apps/gui/skin_engine/skin_parser.c | |
| parent | 0cfd7a388874f3a95662bcd349bd371d497e59f3 (diff) | |
| download | rockbox-81343bae5d377f9ebb7fbc15d87f7f7d782179e8.zip rockbox-81343bae5d377f9ebb7fbc15d87f7f7d782179e8.tar.gz rockbox-81343bae5d377f9ebb7fbc15d87f7f7d782179e8.tar.bz2 rockbox-81343bae5d377f9ebb7fbc15d87f7f7d782179e8.tar.xz | |
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_parser.c')
| -rw-r--r-- | apps/gui/skin_engine/skin_parser.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/apps/gui/skin_engine/skin_parser.c b/apps/gui/skin_engine/skin_parser.c index d6091f9..97f2d9a 100644 --- a/apps/gui/skin_engine/skin_parser.c +++ b/apps/gui/skin_engine/skin_parser.c @@ -1424,12 +1424,12 @@ static bool check_feature_tag(const int type) } } -/* - * initial setup of wps_data; does reset everything - * except fields which need to survive, i.e. - * - **/ -static void skin_data_reset(struct wps_data *wps_data) +/* This is used to free any buflib allocations before the rest of + * wps_data is reset. + * The call to this in settings_apply_skins() is the last chance to do + * any core_free()'s before wps_data is trashed and those handles lost + */ +void skin_data_free_buflib_allocs(struct wps_data *wps_data) { #ifdef HAVE_LCD_BITMAP #ifndef __PCTOOL__ @@ -1442,6 +1442,18 @@ static void skin_data_reset(struct wps_data *wps_data) list = list->next; } #endif +#endif +} + +/* + * initial setup of wps_data; does reset everything + * except fields which need to survive, i.e. + * Also called if the load fails + **/ +static void skin_data_reset(struct wps_data *wps_data) +{ + skin_data_free_buflib_allocs(wps_data); +#ifdef HAVE_LCD_BITMAP wps_data->images = NULL; #endif wps_data->tree = NULL; |