mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 06:32:48 +00:00
Cleanup autosave_free/autosave_deinit
This commit is contained in:
parent
f067ecce50
commit
2a5e74ecb0
@ -246,9 +246,6 @@ error:
|
||||
**/
|
||||
static void autosave_free(autosave_t *handle)
|
||||
{
|
||||
if (!handle)
|
||||
return;
|
||||
|
||||
slock_lock(handle->cond_lock);
|
||||
handle->quit = true;
|
||||
slock_unlock(handle->cond_lock);
|
||||
@ -259,8 +256,9 @@ static void autosave_free(autosave_t *handle)
|
||||
slock_free(handle->cond_lock);
|
||||
scond_free(handle->cond);
|
||||
|
||||
if (handle->buffer)
|
||||
free(handle->buffer);
|
||||
free(handle);
|
||||
handle->buffer = NULL;
|
||||
}
|
||||
|
||||
|
||||
@ -318,9 +316,16 @@ void autosave_deinit(void)
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < autosave_state.num; i++)
|
||||
autosave_free(autosave_state.list[i]);
|
||||
{
|
||||
autosave_t *handle = autosave_state.list[i];
|
||||
if (handle)
|
||||
{
|
||||
autosave_free(handle);
|
||||
free(autosave_state.list[i]);
|
||||
autosave_state.list[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (autosave_state.list)
|
||||
free(autosave_state.list);
|
||||
|
||||
autosave_state.list = NULL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user