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
This commit is contained in:
kichik 2004-09-30 22:47:28 +00:00
parent a0b6163f51
commit 7411f18a9b

View file

@ -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
}