From c6269e3adefdcbe4ed94045135bc3097e5652995 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 27 Dec 2016 15:16:42 +0100 Subject: [PATCH] (task_save.c) Further cleanups --- tasks/task_save.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tasks/task_save.c b/tasks/task_save.c index 63bba32625..7f60bad091 100644 --- a/tasks/task_save.c +++ b/tasks/task_save.c @@ -322,8 +322,8 @@ void autosave_deinit(void) { autosave_free(handle); free(autosave_state.list[i]); - autosave_state.list[i] = NULL; } + autosave_state.list[i] = NULL; } free(autosave_state.list); @@ -345,8 +345,9 @@ void autosave_lock(void) for (i = 0; i < autosave_state.num; i++) { - if (autosave_state.list[i]) - slock_lock(autosave_state.list[i]->lock); + autosave_t *handle = autosave_state.list[i]; + if (handle) + slock_lock(handle->lock); } #endif } @@ -363,9 +364,9 @@ void autosave_unlock(void) for (i = 0; i < autosave_state.num; i++) { - autosave_t *list = autosave_state.list[i]; - if (list) - slock_unlock(list->lock); + autosave_t *handle = autosave_state.list[i]; + if (handle) + slock_unlock(handle->lock); } #endif }