Skip to content

Commit

Permalink
Merge pull request #186 from lihaitao8233/master
Browse files Browse the repository at this point in the history
修复UIRender中文件占用的问题
  • Loading branch information
wangchyz committed Nov 28, 2018
2 parents 6b1ec07 + 6617202 commit c3985f0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions DuiLib/Core/UIRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,11 @@ TImageInfo* CRenderEngine::LoadImage(STRINGorID bitmap, LPCTSTR type, DWORD mask
FILE_ATTRIBUTE_NORMAL, NULL);
if( hFile == INVALID_HANDLE_VALUE ) break;
dwSize = ::GetFileSize(hFile, NULL);
if( dwSize == 0 ) break;
if (dwSize == 0)
{
::CloseHandle(hFile);
break;
}

DWORD dwRead = 0;
pData = new BYTE[ dwSize ];
Expand Down Expand Up @@ -411,7 +415,11 @@ TImageInfo* CRenderEngine::LoadImage(STRINGorID bitmap, LPCTSTR type, DWORD mask
FILE_ATTRIBUTE_NORMAL, NULL);
if( hFile == INVALID_HANDLE_VALUE ) break;
dwSize = ::GetFileSize(hFile, NULL);
if( dwSize == 0 ) break;
if (dwSize == 0)
{
::CloseHandle(hFile);
break;
}

DWORD dwRead = 0;
pData = new BYTE[ dwSize ];
Expand Down

0 comments on commit c3985f0

Please sign in to comment.