From: Vadim Zeitlin Date: Wed, 24 Oct 2012 18:22:17 +0000 (+0000) Subject: Don't iterate over files in wxFileSystemWatcherBase. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/fe6afcb339984c1ff94ccb5138524e7a06a62e1f Don't iterate over files in wxFileSystemWatcherBase. We ignore the files anyhow when recursively adding watches for the entire tree, so don't include them in the iteration. See #14543. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72753 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/fswatchercmn.cpp b/src/common/fswatchercmn.cpp index 9891bb7f3c..14c16bb543 100644 --- a/src/common/fswatchercmn.cpp +++ b/src/common/fswatchercmn.cpp @@ -199,7 +199,7 @@ bool wxFileSystemWatcherBase::AddTree(const wxFileName& path, int events, wxDir dir(path.GetFullPath()); // Prevent asserts or infinite loops in trees containing symlinks - int flags = wxDIR_DEFAULT; // TODO: we ignore files, so why use wxDIR_FILES? + int flags = wxDIR_DIRS; if ( !path.ShouldFollowLink() ) { flags |= wxDIR_NO_FOLLOW; @@ -270,7 +270,7 @@ bool wxFileSystemWatcherBase::RemoveTree(const wxFileName& path) // infinite loops in trees containing symlinks. We need to do the same // or we'll try to remove unwatched items. Let's hope the caller used // the same ShouldFollowLink() setting as in AddTree()... - int flags = wxDIR_DEFAULT; // See the TODO in AddTree() + int flags = wxDIR_DIRS; if ( !path.ShouldFollowLink() ) { flags |= wxDIR_NO_FOLLOW;