From: Vadim Zeitlin Date: Sun, 2 Dec 2012 20:24:38 +0000 (+0000) Subject: Warn, don't assert, about unexpected inotify events. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/aa29d293df42187e42aaa8b3cc5c0f74e8b2b604 Warn, don't assert, about unexpected inotify events. In practice we seem to be getting some unexpected inotify() events during heavy IO activity. This shouldn't happen but it does, so at least don't prevent the program from running by popping up the assertion dialog when it happens. Closes #14854. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73100 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/unix/fswatcher_inotify.cpp b/src/unix/fswatcher_inotify.cpp index f23f4439e3..4801a2f708 100644 --- a/src/unix/fswatcher_inotify.cpp +++ b/src/unix/fswatcher_inotify.cpp @@ -250,11 +250,26 @@ protected: } else { - wxFAIL_MSG("Event for unknown watch descriptor."); + // In theory we shouldn't reach here. In practice, some + // events, e.g. IN_MODIFY, arrive just after the IN_IGNORED + // so their wd has already been discarded. Warn about them. + wxFileSystemWatcherEvent + event + ( + wxFSW_EVENT_WARNING, + wxString::Format + ( + _("Unexpected event for \"%s\": no " + "matching watch descriptor."), + inevt.len ? inevt.name : "" + ) + ); + SendEvent(event); + } // In any case, don't process this event: it's either for an - // already removed entry, or for a completely unknown one. + // already removed entry, or for an unknown one. return; } }