fix AI check

Signed-off-by: LongerJokies <hansiyuan1@huawei.com>
This commit is contained in:
LongerJokies
2026-01-12 20:15:29 +08:00
parent 5d6eceb448
commit d62bd15abe
+3 -1
View File
@@ -681,13 +681,15 @@ bool ResourceAppend::LoadResourceItemWin(const string &filePath)
if (pBuffer == nullptr) {
string errMsg = "map view of file error: " + to_string(GetLastError());
PrintError(GetError(ERR_CODE_READ_FILE_ERROR).FormatCause(filePath.c_str(), errMsg.c_str()));
CloseHandle(hFileMap);
CloseHandle(hReadFile);
return result;
}
char* buffer = reinterpret_cast<char *>(pBuffer);
result = LoadResourceItemFromMem(buffer, fileSize);
UnmapViewOfFile(hFileMap);
UnmapViewOfFile(pBuffer);
CloseHandle(hFileMap);
CloseHandle(hReadFile);
return result;
}