Fixed another serious bug where deleting menus and not returning PLUGIN_HANDLED would cause the iterator to fail and crash

This commit is contained in:
David Anderson
2006-11-21 23:59:21 +00:00
parent c15a23a2a7
commit db7dc509e0
6 changed files with 35 additions and 11 deletions

View File

@@ -87,6 +87,10 @@ void MenuMngr::removeMenuId(int id)
{
if (c->menuid == id)
{
if (m_watch_iter.a == c)
{
++m_watch_iter;
}
if (lc)
lc->next = c->next;
else
@@ -140,4 +144,13 @@ void MenuMngr::clear()
}
}
MenuMngr::iterator MenuMngr::SetWatchIter(MenuMngr::iterator iter)
{
MenuMngr::iterator old = m_watch_iter;
m_watch_iter = iter;
return old;
}
int MenuMngr::MenuIdEle::uniqueid = 0;