diff --git a/src/lib/io/kdirwatch.cpp b/src/lib/io/kdirwatch.cpp --- a/src/lib/io/kdirwatch.cpp +++ b/src/lib/io/kdirwatch.cpp @@ -244,9 +244,6 @@ { timer.stop(); - /* remove all entries being watched */ - removeEntries(nullptr); - #if HAVE_FAM if (use_fam && sn) { FAMClose(&fc); @@ -452,6 +449,11 @@ #endif } +KDirWatchPrivate::Entry::~Entry() +{ + qDeleteAll(m_clients); +} + /* In FAM mode, only entries which are marked dirty are scanned. * We first need to mark all yet nonexistent, but possible created * entries as dirty... diff --git a/src/lib/io/kdirwatch_p.h b/src/lib/io/kdirwatch_p.h --- a/src/lib/io/kdirwatch_p.h +++ b/src/lib/io/kdirwatch_p.h @@ -83,8 +83,9 @@ class Entry { public: + ~Entry(); // instances interested in events - QList m_clients; + QList m_clients; // owned by Entry // nonexistent entries of this directory QList m_entries; QString path;