+
+ // NOTE: We don't use this to delay destruction until the next idle run but rather to
+ // avoid killing ourselves while our caller (which is our wxEvtHandler superclass
+ // ProcessPendingEvents) still needs our m_eventsLocker to be valid.
+ // Since we're in the GUI library we can guarantee that ScheduleForDestroy is using
+ // the GUI implementation which delays destruction and not the base implementation
+ // which does it immediately.
+ wxTheApp->GetTraits()->ScheduleForDestroy(this);