- wxCHECK_RET(it != m_watchMap.end(),
- "Watch descriptor not present in the watch map!");
+ if (it == m_watchMap.end())
+ {
+ // It's not in the map; check if was recently removed from it.
+ if (m_staleDescriptors.Index(inevt.wd) != wxNOT_FOUND)
+ {
+ wxLogTrace(wxTRACE_FSWATCHER,
+ "Got an event for stale wd %i", inevt.wd);
+ }
+ else
+ {
+ wxFAIL_MSG("Event for unknown watch descriptor.");
+ }
+
+ // In any case, don't process this event: it's either for an
+ // already removed entry, or for a completely unknown one.
+ return;
+ }