Cleanup load_images upon task cancellation

This commit is contained in:
twinaphex 2016-05-24 13:35:09 +02:00
parent 811f4f59de
commit 1b35da2bd8

View File

@ -613,12 +613,20 @@ static void rarch_task_overlay_free(retro_task_t *task)
{
unsigned i;
overlay_loader_t *loader = (overlay_loader_t*)task->state;
struct overlay *overlay = &loader->overlays[loader->pos];
if (loader->overlay_path)
free(loader->overlay_path);
if (task->cancelled)
{
for (i = 0; i < overlay->load_images_size; i++)
{
struct texture_image *ti = &overlay->load_images[i];
image_texture_free(ti);
}
for (i = 0; i < loader->size; i++)
input_overlay_free_overlay(&loader->overlays[i]);