delete the event object in ProcessPendingEvents() even if the handler throws an exception (bug 1836010)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51391 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-01-26 23:18:30 +00:00
parent 04d24675d3
commit 47b6fabc7d

View File

@@ -44,6 +44,10 @@
#endif
#include "wx/thread.h"
#include "wx/ptr_scpd.h"
wxDECLARE_SCOPED_PTR(wxEvent, wxEventPtr)
wxDEFINE_SCOPED_PTR(wxEvent, wxEventPtr)
// ----------------------------------------------------------------------------
// wxWin macros
@@ -1167,7 +1171,7 @@ void wxEvtHandler::ProcessPendingEvents()
"should have pending events if called" );
wxList::compatibility_iterator node = m_pendingEvents->GetFirst();
wxEvent * const event = wx_static_cast(wxEvent *, node->GetData());
wxEventPtr event(wx_static_cast(wxEvent *, node->GetData()));
// it's important we remove event from list before processing it, else a
// nested event loop, for example from a modal dialog, might process the
@@ -1186,8 +1190,6 @@ void wxEvtHandler::ProcessPendingEvents()
// careful: this object could have been deleted by the event handler
// executed by the above ProcessEvent() call, so we can't access any fields
// of this object any more
delete event;
}
/*