Fix possible PluginsManager FindClose WINAPI errors
Otherwise the ERROR_INVALID_HANDLE (0x6) can be triggered. Close #14356pull/14359/head
parent
1764758669
commit
ca403b6627
|
@ -447,7 +447,7 @@ bool PluginsManager::loadPlugins(const TCHAR* dir, const PluginViewList* pluginU
|
|||
pathAppend(pluginsFullPathFilter2, dllName2);
|
||||
|
||||
// get plugin
|
||||
if (hFindDll)
|
||||
if (hFindDll && (hFindDll != INVALID_HANDLE_VALUE))
|
||||
{
|
||||
::FindClose(hFindDll);
|
||||
hFindDll = INVALID_HANDLE_VALUE;
|
||||
|
@ -514,8 +514,10 @@ bool PluginsManager::loadPlugins(const TCHAR* dir, const PluginViewList* pluginU
|
|||
}
|
||||
|
||||
}
|
||||
::FindClose(hFindFolder);
|
||||
::FindClose(hFindDll);
|
||||
if (hFindFolder && (hFindFolder != INVALID_HANDLE_VALUE))
|
||||
::FindClose(hFindFolder);
|
||||
if (hFindDll && (hFindDll != INVALID_HANDLE_VALUE))
|
||||
::FindClose(hFindDll);
|
||||
|
||||
for (size_t i = 0, len = dllNames.size(); i < len; ++i)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue