Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.5.3
-
None
Description
The QFileSystemWatcher dnotify implementation is leaking memory.
Compile the attached program and run with valgrind.
NOTE: the program forces set the object name of the QFileSystemWatcher to force the dnotiy implementation.
QFileDialog uses the QFileSystemWatcher resulting in lots of memory leaks when opening files in the application.
The problem is that there are opendir calls without closedir.
FILE: qfilesystemwatcher_dnotify.cpp
In function: QDnotifyFileSystemWatcherEngine::addPaths you can see there are opendir calls but if the
'if statement at line 276' is not true then there are no closedir calls.
I believe the following two lines should be inserted between line 297 - 298:
::closedir(d);
if(parent) ::closedir(parent);