From e56273113da00b04ccdd160ba8966bbd95a84ecc Mon Sep 17 00:00:00 2001 From: spx Date: Sat, 26 Nov 2011 04:41:50 +0000 Subject: [PATCH] Fixed handle leak when failed to get the image file size. --- Library/TintedImage.cpp | 5 +++++ 1 file changed, 5 insertions(+) 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(); } }