- };
-
- if (m_pendingEvents)
- m_pendingEvents->DeleteContents(true);
- delete m_pendingEvents;
-
- // Remove us from wxHandlersWithPendingEvents if necessary.
- if ( wxHandlersWithPendingEvents )
- {
-#if wxUSE_THREADS
- if (wxHandlersWithPendingEventsLocker)
- wxENTER_CRIT_SECT(*wxHandlersWithPendingEventsLocker);
-#endif
-
- if ( wxHandlersWithPendingEvents->DeleteObject(this) )
- {
- // check that we were present only once in the list
- wxASSERT_MSG( !wxHandlersWithPendingEvents->Find(this),
- "Handler occurs twice in wxHandlersWithPendingEvents list" );
- }
- //else: we weren't in this list at all, it's ok