From 9f54c829ed641e921839819b72fc8b4e060d9163 Mon Sep 17 00:00:00 2001 From: Francesco Montorsi Date: Thu, 19 Feb 2009 20:57:47 +0000 Subject: [PATCH] don't leak events in wxEvtHandler::QueueEvent when there's no event loop git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59037 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/event.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/common/event.cpp b/src/common/event.cpp index 7d98a3e6d0..3c67d098f7 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -1129,7 +1129,11 @@ void wxEvtHandler::QueueEvent(wxEvent *event) { // we need an event loop which manages the list of event handlers with // pending events... cannot proceed without it! - wxLogDebug("No event loop is running!"); + wxLogDebug("No event loop is running! Cannot queue this event!"); + + // anyway delete the given event to avoid memory leaks + delete event; + return; } @@ -1166,7 +1170,7 @@ void wxEvtHandler::ProcessPendingEvents() { // we need an event loop which manages the list of event handlers with // pending events... cannot proceed without it! - wxLogDebug("No event loop is running!"); + wxLogDebug("No event loop is running! Cannot process pending events!"); return; }