From 71c3227ba260b964b0c9516f05ad4f2e6fa72f69 Mon Sep 17 00:00:00 2001 From: "Bradley T. Hughes" Date: Fri, 27 Nov 2009 15:10:16 +0100 Subject: 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 --- src/corelib/io/qfilesystemwatcher_dnotify.cpp | 3 +++ 1 file changed, 3 insertions(+) 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]; -- cgit v0.12