Merge pull request #1319 from ObjSal/develop

Fixes an issue in DirectoryWatcher where it stops listening for events
This commit is contained in:
Günter Obiltschnig 2016-08-02 13:07:14 +08:00 committed by GitHub
commit cab7142a4e

View File

@ -108,7 +108,20 @@ protected:
DirectoryIterator end;
while (it != end)
{
entries[it.path().getFileName()] = ItemInfo(*it);
// DirectoryWatcher should not stop watching if it fails to get the info
// of a file, it should just ignore it.
try
{
entries[it.path().getFileName()] = ItemInfo(*it);
}
catch(const Poco::FileNotFoundException& fnfe)
{
// The file is missing, remove it from the entries so it is treated as
// deleted.
entries.erase(it.path().getFileName());
poco_unexpected();
}
++it;
}
}