]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/event.cpp
Allow wxMac to have HRULE/VRULEs for wxListCtrl too.
[wxWidgets.git] / src / common / event.cpp
index 7bb9ba699dfab4ec1b97b804a6e8f9b251f4b8ca..5f24b7489ffe84d127475de6058acc80913856c6 100644 (file)
@@ -1044,8 +1044,10 @@ wxEvtHandler::~wxEvtHandler()
     // Remove us from wxPendingEvents if necessary.
     if(wxPendingEventsLocker)
         wxENTER_CRIT_SECT(*wxPendingEventsLocker);
-    if ( wxPendingEvents ) {
-        wxPendingEvents->DeleteObject(this);
+    if ( wxPendingEvents )
+    {
+        // Delete all occurences of this from the list of pending events
+        while (wxPendingEvents->DeleteObject(this)) { } // Do nothing
     }
     if(wxPendingEventsLocker)
         wxLEAVE_CRIT_SECT(*wxPendingEventsLocker);