From 99d24d9954712fdd51cdb9dad12e14d427454228 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 21 Sep 2016 04:19:59 +0200 Subject: [PATCH] Cleanup --- tasks/task_content.c | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/tasks/task_content.c b/tasks/task_content.c index 24d5b50259..f6e28355e0 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -732,29 +732,6 @@ error: return ret; } -static bool content_file_free(struct string_list *temporary_content) -{ - unsigned i; - - if (!temporary_content) - return false; - - for (i = 0; i < temporary_content->size; i++) - { - const char *path = temporary_content->elems[i].data; - - RARCH_LOG("%s: %s.\n", - msg_hash_to_str(MSG_REMOVING_TEMPORARY_CONTENT_FILE), path); - if (remove(path) < 0) - RARCH_ERR("%s: %s.\n", - msg_hash_to_str(MSG_FAILED_TO_REMOVE_TEMPORARY_FILE), - path); - } - string_list_free(temporary_content); - - return true; -} - bool content_does_not_need_content(void) { return core_does_not_need_content; @@ -785,7 +762,24 @@ bool content_is_inited(void) void content_deinit(void) { - content_file_free(temporary_content); + unsigned i; + + if (temporary_content) + { + for (i = 0; i < temporary_content->size; i++) + { + const char *path = temporary_content->elems[i].data; + + RARCH_LOG("%s: %s.\n", + msg_hash_to_str(MSG_REMOVING_TEMPORARY_CONTENT_FILE), path); + if (remove(path) < 0) + RARCH_ERR("%s: %s.\n", + msg_hash_to_str(MSG_FAILED_TO_REMOVE_TEMPORARY_FILE), + path); + } + string_list_free(temporary_content); + } + temporary_content = NULL; content_crc = 0; _content_is_inited = false;