summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorgunnar <gunnar@trolltech.com>2009-09-22 05:34:51 (GMT)
committergunnar <gunnar@trolltech.com>2009-09-22 16:53:41 (GMT)
commit0691350e14632dea6c12a2d37e605dc0628b4ceb (patch)
tree29893faa4f20c74acd49839d5436ea1cbe3bc721 /src/corelib/io
parent0d8d7427c8cc0d9b47a81ca8343773b0481b87ad (diff)
downloadQt-0691350e14632dea6c12a2d37e605dc0628b4ceb.zip
Qt-0691350e14632dea6c12a2d37e605dc0628b4ceb.tar.gz
Qt-0691350e14632dea6c12a2d37e605dc0628b4ceb.tar.bz2
Fixed crash in QFileSystemWatcher for addPath(nonExistingFile)
Reviewed-by: Eskil
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qfilesystemwatcher_fsevents.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_fsevents.cpp b/src/corelib/io/qfilesystemwatcher_fsevents.cpp
index f648016..be2125a 100644
--- a/src/corelib/io/qfilesystemwatcher_fsevents.cpp
+++ b/src/corelib/io/qfilesystemwatcher_fsevents.cpp
@@ -223,6 +223,11 @@ QStringList QFSEventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
}
}
}
+
+ if (!pathsToWatch && failedToAdd.size() == paths.size()) {
+ return failedToAdd;
+ }
+
if (CFArrayGetCount(tmpArray) > 0) {
if (pathsToWatch) {
CFArrayAppendArray(tmpArray, pathsToWatch, CFRangeMake(0, CFArrayGetCount(pathsToWatch)));
@@ -230,6 +235,7 @@ QStringList QFSEventsFileSystemWatcherEngine::addPaths(const QStringList &paths,
}
pathsToWatch = CFArrayCreateCopy(kCFAllocatorDefault, tmpArray);
}
+
FSEventStreamContext context = { 0, this, 0, 0, 0 };
fsStream = FSEventStreamCreate(kCFAllocatorDefault,
QFSEventsFileSystemWatcherEngine::fseventsCallback,