/////////////////////////////////////////////////////////////////////////////
-// Name: event.cpp
+// Name: src/common/event.cpp
// Purpose: Event classes
// Author: Julian Smart
// Modified by:
#endif
#ifndef WX_PRECOMP
- #include "wx/defs.h"
#include "wx/app.h"
#include "wx/list.h"
delete m_dynamicEvents;
};
+ if (m_pendingEvents)
+ m_pendingEvents->DeleteContents(true);
delete m_pendingEvents;
#if wxUSE_THREADS
wxLEAVE_CRIT_SECT(*wxPendingEventsLocker);
- // 3) Inform the system that new pending events are somwehere,
+ // 3) Inform the system that new pending events are somewhere,
// and that these should be processed in idle time.
wxWakeUpIdle();
}
{
wxEvent *event = (wxEvent *)node->GetData();
+ // It's importan we remove event from list before processing it.
+ // Else a nested event loop, for example from a modal dialog, might
+ // process the same event again.
m_pendingEvents->Erase(node);
wxLEAVE_CRIT_SECT( Lock() );