mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-23 13:54:54 +02:00
Fix incompatible plugin not being deleted issue
Unload incompatible plugin before deleting it. Fix #9377, close #9382
This commit is contained in:
parent
b58a5cc227
commit
a55d46d170
@ -275,10 +275,14 @@ int PluginsManager::loadPlugin(const TCHAR *pluginFilePath)
|
|||||||
s += USERMSG;
|
s += USERMSG;
|
||||||
if (::MessageBox(NULL, s.c_str(), pluginFilePath, MB_YESNO) == IDYES)
|
if (::MessageBox(NULL, s.c_str(), pluginFilePath, MB_YESNO) == IDYES)
|
||||||
{
|
{
|
||||||
|
if (pi && pi->_hLib)
|
||||||
|
{
|
||||||
|
::FreeLibrary(pi->_hLib);
|
||||||
|
}
|
||||||
::DeleteFile(pluginFilePath);
|
::DeleteFile(pluginFilePath);
|
||||||
}
|
}
|
||||||
delete pi;
|
delete pi;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@ -288,10 +292,14 @@ int PluginsManager::loadPlugin(const TCHAR *pluginFilePath)
|
|||||||
msg += USERMSG;
|
msg += USERMSG;
|
||||||
if (::MessageBox(NULL, msg.c_str(), pluginFilePath, MB_YESNO) == IDYES)
|
if (::MessageBox(NULL, msg.c_str(), pluginFilePath, MB_YESNO) == IDYES)
|
||||||
{
|
{
|
||||||
|
if (pi && pi->_hLib)
|
||||||
|
{
|
||||||
|
::FreeLibrary(pi->_hLib);
|
||||||
|
}
|
||||||
::DeleteFile(pluginFilePath);
|
::DeleteFile(pluginFilePath);
|
||||||
}
|
}
|
||||||
delete pi;
|
delete pi;
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user