diff --git a/docs/changes.txt b/docs/changes.txt index d5269b0e1c..517228fcd1 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -626,6 +626,7 @@ wxGTK: - Fix GTK+ warnings when refreshing wxListCtrl items (Scott Talbert). - Fix using wxHTTP and wxFTP from worker thread. - Make items selected from keyboard visible in wxListCtrl (Jonathan Dagresta). +- Fix crashes in wxFileSystemWatcher implementation (David Hart). wxMSW: diff --git a/src/unix/fswatcher_inotify.cpp b/src/unix/fswatcher_inotify.cpp index 36d666578d..efff1b3a56 100644 --- a/src/unix/fswatcher_inotify.cpp +++ b/src/unix/fswatcher_inotify.cpp @@ -385,6 +385,7 @@ protected: // if the wd isn't found: repeated IN_DELETE_SELFs can occur wxFileName fn = GetEventPath(watch, inevt); wxString path(fn.GetPathWithSep()); + const wxString filespec(watch.GetFilespec()); if (m_watchMap.erase(inevt.wd) == 1) { @@ -406,7 +407,7 @@ protected: // Tell the owner, in case it's interested // If there's a filespec, assume he's not - if (watch.GetFilespec().empty()) + if (filespec.empty()) { wxFileSystemWatcherEvent event(flags, fn, fn); SendEvent(event);