Skip to content

Commit

Permalink
fixed: The savegame's PNG loader must use a caching FileReader to avo…
Browse files Browse the repository at this point in the history
…id holding a handle to the containing file.

This blocked savegame deletion.
  • Loading branch information
coelckers committed May 1, 2024
1 parent 81dade9 commit f2d582f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/menu/savegamemanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ unsigned FSavegameManagerBase::ExtractSaveData(int index)
auto pic = resf->FindEntry("savepic.png");
if (pic >= 0)
{
FileReader picreader = resf->GetEntryReader(pic, FileSys::READER_NEW, FileSys::READERFLAG_SEEKABLE);
// This must use READER_CACHED or it will lock the savegame file.
FileReader picreader = resf->GetEntryReader(pic, FileSys::READER_CACHED, FileSys::READERFLAG_SEEKABLE);
PNGHandle *png = M_VerifyPNG(picreader);
if (png != nullptr)
{
Expand Down

0 comments on commit f2d582f

Please sign in to comment.