diff --git a/Library/TintedImage.cpp b/Library/TintedImage.cpp index fed708ee..bf7bc588 100644 --- a/Library/TintedImage.cpp +++ b/Library/TintedImage.cpp @@ -358,6 +358,11 @@ void CTintedImage::LoadImage(const std::wstring& imageName, bool bLoadAlways) else { LogWithArgs(LOG_ERROR, L"%s: Unable to open: %s", m_ConfigName.c_str(), filename.c_str()); + + if (fileHandle != INVALID_HANDLE_VALUE) + { + CloseHandle(fileHandle); + } DisposeImage(); } }