I have a window that I attach a hidden event in runtime. This is the code I use for adding removing the event:
Code: Select all
template <class _T>
void SetResultCallback(bool (_T::*function)(const EventArgs&), _T* pObj)
{
this->m_pWindow->subscribeEvent (CEGUI::FrameWindow::EventHidden, Event::Subscriber(function,pObj));
}
void CYesNoDialog::RemoveResultCallback()
{
this->m_pWindow->removeEvent(CEGUI::FrameWindow::EventHidden);
}
The problem is the following: I can attach a handler without problem and it works ok, but when I call RemoveResultCallback(), and later on I call m_pWindow->hide() wich trows an exception (This m_pWindow is the window I added and removed a handler for the hidden event) saying:
Expresion: map/set iterator not incrementable.
I can guess what's hapenning, but don´t know how to fix it, or if I´m not removing the event correctly.
Can anyone help here?
Thanks in advance,
HexDUmp.