From b1b8fc65cfb0a922eb67ed882767efec4c63b3c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 12 Mar 2023 19:20:01 +0100 Subject: [PATCH] Error handling fixes (close the file). --- GPU/Common/ReplacedTexture.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/GPU/Common/ReplacedTexture.cpp b/GPU/Common/ReplacedTexture.cpp index d07c18cac1..d8803a5f8a 100644 --- a/GPU/Common/ReplacedTexture.cpp +++ b/GPU/Common/ReplacedTexture.cpp @@ -364,6 +364,7 @@ bool ReplacedTexture::LoadLevelData(VFSFileReference *fileRef, const std::string // Already populated from cache. TODO: Move this above the first read, and take level.w/h from the cache. if (!out.empty()) { + vfs_->CloseFile(openFile); *pixelFormat = levelData_->fmt; return true; } @@ -382,6 +383,7 @@ bool ReplacedTexture::LoadLevelData(VFSFileReference *fileRef, const std::string } if (!good) { + vfs_->CloseFile(openFile); return false; }