[Differential] [Request, 11 lines] D4439: KDirWatch: fix memory leak on destruction.
David Faure
noreply at phabricator.kde.org
Sun Feb 5 10:53:04 UTC 2017
dfaure created this revision.
dfaure added reviewers: aacid, mpyne.
dfaure added a subscriber: Frameworks.
Restricted Application added a project: Frameworks.
REVISION SUMMARY
The Entry class owns the Client instances, so it should delete the
remaining instances in its destructor, for the case where they haven't
been removed one by one. The line of code removeEntries(nullptr) was
probably means to remove them one by one, but it was a no-op (the code
for that method doesn't expect nullptr as argument) and it would be
slow anyway. We don't need to call inotify_remove for every path,
when we're just cleaning up in a global static after qApp destruction.
Detected by a clang-sanitizer build on http://ci-logs.kde.flaska.net
and reproduced locally with valgrind.
TEST PLAN
./kdirwatch_*_unittest now passes in valgrind without memory
leaks being reported
REPOSITORY
R244 KCoreAddons
BRANCH
master
REVISION DETAIL
https://phabricator.kde.org/D4439
AFFECTED FILES
src/lib/io/kdirwatch.cpp
src/lib/io/kdirwatch_p.h
EMAIL PREFERENCES
https://phabricator.kde.org/settings/panel/emailpreferences/
To: dfaure, aacid, mpyne
Cc: #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170205/633365bd/attachment.html>
More information about the Kde-frameworks-devel
mailing list