KDirWatch crash fix

David Faure faure at kde.org
Sat Mar 15 22:01:19 GMT 2008


After making some changes to kdirmodeltest I've been hitting a reproduceable crash in KDirWatch.

The problem comes from this code in removeEntry:
      if (e->isDir)
        removeEntry(0, QDir::cleanPath(e->path+"/.."), e);
      else
        removeEntry(0, QFileInfo(e->path).absolutePath(), e);

If the entry for that "parent directory" is in removeList (the list of removed deletions)
then when processing that list it will crash, due to looking at an already-deleted entry.

Any objections against the attached patch?

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kdirwatch.diff
Type: text/x-diff
Size: 2316 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080315/ccf20735/attachment.diff>


More information about the kde-core-devel mailing list