summaryrefslogtreecommitdiff
path: root/src/corelib
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2010-11-26 10:11:15 +0100
committerJoão Abecasis <joao.abecasis@nokia.com>2010-11-26 17:42:00 +0100
commit4e6cc34b75fd42d663ced0f3da1c9a9a6950fb6f (patch)
tree80e3540450ba687766d45b47c19411f13cb6b97a /src/corelib
parent5784daa662e1ace86e6046bf369e9029d57c32d8 (diff)
downloadqt4-tools-4e6cc34b75fd42d663ced0f3da1c9a9a6950fb6f.tar.gz
QKqueueFileSystemWatcher: don't stop thread that isn't running
When removing paths from the watch list, if we end up with an empty watch list, we would send a request to the processing thread to quit. In the case where the watch list was empty to begin with (the paths being removed weren't actually being watched) the request to quit would still be queued. If the processing thread wasn't running (and it shouldn't if there weren't any paths being watched) the request to quit would still be posted but not processed. The next time paths were added and the thread started, the request would be processed and the thread would quit at once. When removing paths from the list, we now check whether the watch list is empty to begin with and exit early without asking the processing thread to quit itself. Task-Number: QTBUG-14435 Reviewed-by: Bradley T. Hughes
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qfilesystemwatcher_kqueue.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_kqueue.cpp b/src/corelib/io/qfilesystemwatcher_kqueue.cpp
index 0103abd2c9..3664396048 100644
--- a/src/corelib/io/qfilesystemwatcher_kqueue.cpp
+++ b/src/corelib/io/qfilesystemwatcher_kqueue.cpp
@@ -206,6 +206,8 @@ QStringList QKqueueFileSystemWatcherEngine::removePaths(const QStringList &paths
QStringList p = paths;
{
QMutexLocker locker(&mutex);
+ if (pathToID.isEmpty())
+ return p;
QMutableListIterator<QString> it(p);
while (it.hasNext()) {