From 1c46eb838fd12de277161bd7a9e304bc8bdba900 Mon Sep 17 00:00:00 2001 From: u0u0 Date: Thu, 12 Sep 2019 21:15:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=B3=E9=97=AD=20win32=20isFileExistInterna?= =?UTF-8?q?l=20=E4=B8=AD=E7=9A=84find=E5=8F=A5=E6=9F=84=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cocos/platform/win32/CCFileUtils-win32.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cocos/platform/win32/CCFileUtils-win32.cpp b/cocos/platform/win32/CCFileUtils-win32.cpp index fac9264..cda9a91 100644 --- a/cocos/platform/win32/CCFileUtils-win32.cpp +++ b/cocos/platform/win32/CCFileUtils-win32.cpp @@ -120,7 +120,10 @@ bool FileUtilsWin32::isFileExistInternal(const std::string& strFilePath) const else { WIN32_FIND_DATAA ffd; - HANDLE hFind = FindFirstFileA(strPath.c_str(), &ffd); + HANDLE hFind = FindFirstFileA(strPath.c_str(), &ffd); + if (hFind != INVALID_HANDLE_VALUE) { + FindClose(hFind); + } std::string filename(ffd.cFileName); size_t pos = strFilePath.find(filename); if (pos + filename.length() != strFilePath.length()) -- GitLab