Skip to content
Commit 254a0edc authored by Harald Sitter's avatar Harald Sitter 🐧
Browse files

kdirwatch: don't leave relative entries dangling

another supremely awkward bug revealed by forcing good refcounting...

previously when the user had called `addFile()` with a relative path
we'd happily create an `Entry` for it but never remove it. this was
because `entry()` would not return a matching entry when the path was
relative. this then left relative entries dangle with potentially
invalid `client` members.

specifically in the call chain `::~KDirWatch -> ::removeEntries ->
::removeEntry -> ::entry` that was of considerable problem as the
KDirWatch instances cleanup request was effectively ignored.

eventually when cleanup of the private happened we'd then tap into
invalid memory when trying to clean up the client.

the presented test case demonstrates this and the fix is simply not
checking for relativity when the rest of the class doesn't either
parent bc909ba4
Pipeline #512883 passed with stage
in 3 minutes and 11 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment