]> git.saurik.com Git - wxWidgets.git/commitdiff
don't leak events in wxEvtHandler::QueueEvent when there's no event loop
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Thu, 19 Feb 2009 20:57:47 +0000 (20:57 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Thu, 19 Feb 2009 20:57:47 +0000 (20:57 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59037 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/event.cpp

index 7d98a3e6d0f8bff41f0da0ab31eef7929dd8de39..3c67d098f7a0caeab2dfe187044cd53e01b9840d 100644 (file)
@@ -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;
     }