mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-10-14 02:27:39 -04:00
Fix a crash introduced in a605cdf70
Pretty subtle problem; looks like the skin core was relying on a destructor to actually help initialize things. Change-Id: Ieb4b9e4f11377dec7be61d13759590fc5f4bc921
This commit is contained in:
parent
8c8284bbe6
commit
a5a8e00b6d
1 changed files with 5 additions and 3 deletions
|
@ -1715,7 +1715,7 @@ void skin_data_free_buflib_allocs(struct wps_data *wps_data)
|
||||||
if (wps_data->wps_loaded)
|
if (wps_data->wps_loaded)
|
||||||
skin_buffer = get_skin_buffer(wps_data);
|
skin_buffer = get_skin_buffer(wps_data);
|
||||||
if (!skin_buffer)
|
if (!skin_buffer)
|
||||||
return;
|
goto abort;
|
||||||
|
|
||||||
#ifndef __PCTOOL__
|
#ifndef __PCTOOL__
|
||||||
struct skin_token_list *list = SKINOFFSETTOPTR(skin_buffer, wps_data->images);
|
struct skin_token_list *list = SKINOFFSETTOPTR(skin_buffer, wps_data->images);
|
||||||
|
@ -1744,13 +1744,15 @@ void skin_data_free_buflib_allocs(struct wps_data *wps_data)
|
||||||
}
|
}
|
||||||
list = SKINOFFSETTOPTR(skin_buffer, list->next);
|
list = SKINOFFSETTOPTR(skin_buffer, list->next);
|
||||||
}
|
}
|
||||||
wps_data->images = PTRTOSKINOFFSET(skin_buffer, NULL);
|
|
||||||
if (font_ids != NULL)
|
if (font_ids != NULL)
|
||||||
{
|
{
|
||||||
while (wps_data->font_count > 0)
|
while (wps_data->font_count > 0)
|
||||||
font_unload(font_ids[--wps_data->font_count]);
|
font_unload(font_ids[--wps_data->font_count]);
|
||||||
}
|
}
|
||||||
wps_data->font_ids = PTRTOSKINOFFSET(skin_buffer, NULL);
|
|
||||||
|
abort:
|
||||||
|
wps_data->font_ids = PTRTOSKINOFFSET(skin_buffer, NULL); /* Safe if skin_buffer is NULL */
|
||||||
|
wps_data->images = PTRTOSKINOFFSET(skin_buffer, NULL);
|
||||||
if (wps_data->buflib_handle > 0)
|
if (wps_data->buflib_handle > 0)
|
||||||
core_free(wps_data->buflib_handle);
|
core_free(wps_data->buflib_handle);
|
||||||
wps_data->buflib_handle = -1;
|
wps_data->buflib_handle = -1;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue