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

@@ -76,7 +76,8 @@ private:
} *headcmd;
public:
MenuMngr() { headid = 0; headcmd = 0; }
MenuMngr() : m_watch_iter(end())
{ headid = NULL; headcmd = NULL; }
~MenuMngr();
// Interface
@@ -89,6 +90,7 @@ public:
class iterator
{
friend class MenuMngr;
MenuCommand* a;
public:
iterator(MenuCommand*aa) : a(aa) {}
@@ -101,6 +103,11 @@ public:
inline iterator begin() const { return iterator(headcmd); }
inline iterator end() const { return iterator(0); }
MenuMngr::iterator SetWatchIter(MenuMngr::iterator iter);
inline MenuMngr::iterator GetWatchIter() { return m_watch_iter; }
private:
MenuMngr::iterator m_watch_iter;
};
#endif //MENUS_H