Skip to content

Commit

Permalink
修复UIRender中文件占用的问题
Browse files Browse the repository at this point in the history
Signed-off-by: lihaitao8233 <[email protected]>
  • Loading branch information
lihaitao8233 committed Nov 28, 2018
1 parent 6b1ec07 commit 6617202
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 6617202

Please sign in to comment.