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/branches/WX_2_8_BRANCH@51391 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -41,6 +41,11 @@
|
|||||||
#endif // wxUSE_GUI
|
#endif // wxUSE_GUI
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "wx/ptr_scpd.h"
|
||||||
|
|
||||||
|
wxDECLARE_SCOPED_PTR(wxEvent, wxEventPtr)
|
||||||
|
wxDEFINE_SCOPED_PTR(wxEvent, wxEventPtr)
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxWin macros
|
// wxWin macros
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -1170,9 +1175,9 @@ void wxEvtHandler::ProcessPendingEvents()
|
|||||||
node;
|
node;
|
||||||
node = m_pendingEvents->GetFirst() )
|
node = m_pendingEvents->GetFirst() )
|
||||||
{
|
{
|
||||||
wxEvent *event = (wxEvent *)node->GetData();
|
wxEventPtr event(wx_static_cast(wxEvent *, node->GetData()));
|
||||||
|
|
||||||
// It's importan we remove event from list before processing it.
|
// It's important we remove event from list before processing it.
|
||||||
// Else a nested event loop, for example from a modal dialog, might
|
// Else a nested event loop, for example from a modal dialog, might
|
||||||
// process the same event again.
|
// process the same event again.
|
||||||
|
|
||||||
@@ -1182,8 +1187,6 @@ void wxEvtHandler::ProcessPendingEvents()
|
|||||||
|
|
||||||
ProcessEvent(*event);
|
ProcessEvent(*event);
|
||||||
|
|
||||||
delete event;
|
|
||||||
|
|
||||||
wxENTER_CRIT_SECT( Lock() );
|
wxENTER_CRIT_SECT( Lock() );
|
||||||
|
|
||||||
if ( --n == 0 )
|
if ( --n == 0 )
|
||||||
|
Reference in New Issue
Block a user