DBG: fixed a bug in _plugin_menuclear (now it no longer deletes the menu itself)
This commit is contained in:
parent
afd18d870f
commit
caae4a9d6a
|
@ -85,7 +85,7 @@ PLUG_IMPEXP bool _plugin_menuaddseparator(int hMenu)
|
|||
|
||||
PLUG_IMPEXP bool _plugin_menuclear(int hMenu)
|
||||
{
|
||||
return pluginmenuclear(hMenu);
|
||||
return pluginmenuclear(hMenu, false);
|
||||
}
|
||||
|
||||
PLUG_IMPEXP void _plugin_menuseticon(int hMenu, const ICONDATA* icon)
|
||||
|
|
|
@ -352,7 +352,7 @@ bool pluginunload(const char* pluginName, bool unloadall)
|
|||
}
|
||||
{
|
||||
EXCLUSIVE_ACQUIRE(LockPluginList);
|
||||
pluginmenuclear(currentPlugin.hMenu);
|
||||
pluginmenuclear(currentPlugin.hMenu, true);
|
||||
|
||||
//remove from main pluginlist. We do this so unloadall doesn't try to unload an already released plugin
|
||||
auto pbegin = pluginList.begin();
|
||||
|
@ -673,7 +673,7 @@ bool pluginmenuaddseparator(int hMenu)
|
|||
\param hMenu The menu to clear.
|
||||
\return true if it succeeds, false otherwise.
|
||||
*/
|
||||
bool pluginmenuclear(int hMenu)
|
||||
bool pluginmenuclear(int hMenu, bool erase)
|
||||
{
|
||||
EXCLUSIVE_ACQUIRE(LockPluginMenuList);
|
||||
bool bFound = false;
|
||||
|
@ -682,7 +682,8 @@ bool pluginmenuclear(int hMenu)
|
|||
const auto & currentMenu = *it;
|
||||
if(currentMenu.hEntryMenu == hMenu && currentMenu.hEntryPlugin == -1)
|
||||
{
|
||||
it = pluginMenuList.erase(it);
|
||||
if(erase)
|
||||
it = pluginMenuList.erase(it);
|
||||
bFound = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -74,7 +74,7 @@ bool plugincmdunregister(int pluginHandle, const char* command);
|
|||
int pluginmenuadd(int hMenu, const char* title);
|
||||
bool pluginmenuaddentry(int hMenu, int hEntry, const char* title);
|
||||
bool pluginmenuaddseparator(int hMenu);
|
||||
bool pluginmenuclear(int hMenu);
|
||||
bool pluginmenuclear(int hMenu, bool erase);
|
||||
void pluginmenucall(int hEntry);
|
||||
bool pluginwinevent(MSG* message, long* result);
|
||||
bool pluginwineventglobal(MSG* message);
|
||||
|
|
Loading…
Reference in New Issue