diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-11-27 14:10:16 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-11-27 14:18:01 (GMT) |
commit | 71c3227ba260b964b0c9516f05ad4f2e6fa72f69 (patch) | |
tree | 89e49421c8aa1162ad5c5a384502db74af1b6062 /src/corelib/io | |
parent | ef17dac74688a8754aa4434a24ddb19d2ab4dcc5 (diff) | |
download | Qt-71c3227ba260b964b0c9516f05ad4f2e6fa72f69.zip Qt-71c3227ba260b964b0c9516f05ad4f2e6fa72f69.tar.gz Qt-71c3227ba260b964b0c9516f05ad4f2e6fa72f69.tar.bz2 |
Fix memory leak in the DNotify implementation of QFileSystemWatcher
Make sure that all calls to opendir() are paired with a call closedir().
Reviewed-by: Marius Storm-Olsen
Task-number: QTBUG-4840
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qfilesystemwatcher_dnotify.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/io/qfilesystemwatcher_dnotify.cpp b/src/corelib/io/qfilesystemwatcher_dnotify.cpp index 17ac9c6..03172e5 100644 --- a/src/corelib/io/qfilesystemwatcher_dnotify.cpp +++ b/src/corelib/io/qfilesystemwatcher_dnotify.cpp @@ -295,6 +295,9 @@ QStringList QDnotifyFileSystemWatcherEngine::addPaths(const QStringList &paths, pathToFD.insert(path, fd); if(parentFd) parentToFD.insert(parentFd, fd); + + ::closedir(d); + if(parent) ::closedir(parent); } Directory &directory = fdToDirectory[fd]; |