From 7411f18a9b5a784e920c7bd9caf8586938f7a835 Mon Sep 17 00:00:00 2001 From: kichik Date: Thu, 30 Sep 2004 22:47:28 +0000 Subject: [PATCH] only close file handle once in MMapFile::clear() git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3686 212acab6-be3b-0410-9dea-997c60f758d6 --- Source/strlist.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/strlist.h b/Source/strlist.h index 3a90e93b..0360241a 100644 --- a/Source/strlist.h +++ b/Source/strlist.h @@ -527,13 +527,16 @@ class MMapFile : public IMMap #ifdef _WIN32 if (m_hFileMap) CloseHandle(m_hFileMap); - if (m_bTempHandle && m_hFile) + if (m_bTempHandle && m_hFile != INVALID_HANDLE_VALUE) CloseHandle(m_hFile); + m_hFile = INVALID_HANDLE_VALUE; m_hFileMap = 0; #else if (m_bTempHandle && m_hFile) fclose(m_hFile); + + m_hFile = NULL; #endif }