Skip to content

Commit

Permalink
Delete savestate thumbnails if needed
Browse files Browse the repository at this point in the history
Apply garbage collection also for the savestate thumbnails.
  • Loading branch information
zoltanvb committed Aug 2, 2024
1 parent 38b3ba4 commit 5970fd3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions command.c
Original file line number Diff line number Diff line change
Expand Up @@ -1558,7 +1558,13 @@ void command_event_set_savestate_garbage_collect(
* the risk of deleting multiple incorrect files
* in case of accident */
if (!string_is_empty(oldest_save) && (cnt > max_to_keep))
{
filestream_delete(oldest_save);
/* Construct the save state thumbnail name
* and delete that one as well. */
i = strlcpy(state_dir,oldest_save,PATH_MAX_LENGTH);
strlcpy(state_dir + i,".png",STRLEN_CONST(".png")+1);
}

dir_list_free(dir_list);
}
Expand Down

0 comments on commit 5970fd3

Please sign in to comment.