fixed: The savegame's PNG loader must use a caching FileReader to avoid holding a handle to the containing file.

This blocked savegame deletion.
This commit is contained in:
Christoph Oelckers 2024-05-01 09:49:45 +02:00
parent 81dade9ed5
commit f2d582f680

View file

@ -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)
{