summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfilesystemwatcher_win.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-06-09 09:53:18 +0200
committerFriedemann Kleint <Friedemann.Kleint@theqtcompany.com>2015-06-09 09:50:35 +0000
commitbf440c18bb60a6964b32778157db2a22b168e946 (patch)
treefb2fe8c69ea5dc17961d2e4fd3b0c1436877ebe7 /src/corelib/io/qfilesystemwatcher_win.cpp
parentb38615c7e4fbaea198503a8fde3224066a0ae616 (diff)
Fix return value of QWindowsFileSystemWatcherEngine::removePaths().
Previously, the path was removed from list returned (indicating failure to remove) only when the thread's list was empty (last file in directory). Move the statement up so that removal happens when it is found in thread's list. Task-number: QTBUG-46449 Change-Id: Ib79199c731f79357b0e5c17636254fbeb3a754a0 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/corelib/io/qfilesystemwatcher_win.cpp')
-rw-r--r--src/corelib/io/qfilesystemwatcher_win.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_win.cpp b/src/corelib/io/qfilesystemwatcher_win.cpp
index 039992adba..4907a20a5f 100644
--- a/src/corelib/io/qfilesystemwatcher_win.cpp
+++ b/src/corelib/io/qfilesystemwatcher_win.cpp
@@ -248,6 +248,7 @@ QStringList QWindowsFileSystemWatcherEngine::removePaths(const QStringList &path
// ###
files->removeAll(path);
directories->removeAll(path);
+ it.remove();
if (h.isEmpty()) {
DEBUG() << "Closing handle" << handle.handle;
@@ -260,8 +261,6 @@ QStringList QWindowsFileSystemWatcherEngine::removePaths(const QStringList &path
thread->handleForDir.remove(QFileSystemWatcherPathKey(absolutePath));
// h is now invalid
- it.remove();
-
if (thread->handleForDir.isEmpty()) {
DEBUG() << "Stopping thread " << thread;
locker.unlock();