https://bugs.kde.org/show_bug.cgi?id=260741
Milian Wolff <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |RESOLVED Latest Commit| |https://invent.kde.org/kde/ | |kdevelop/commit/06b526e81f9 | |f9065d1725b4f35985e71dc0dc2 | |e3 Resolution|--- |FIXED --- Comment #22 from Milian Wolff <[email protected]> --- Git commit 06b526e81f9f9065d1725b4f35985e71dc0dc2e3 by Milian Wolff. Committed on 01/02/2019 at 12:45. Pushed by mwolff into branch 'master'. Properly cleanup FileManagerListJob when folder items are deleted This is an alternative approach to fix the issue described in https://phabricator.kde.org/D15899 The approach used here is generic and does not require any users of the API to know about the potential pitfalls, it actually decreases coupling a bit! The old approach to cleanup the list jobs only worked when we called AbstractFileManagerPluginPrivate::removeFolder, but that wouldn't work when a folder item gets deleted directly - e.g. from the CMakeManager or any other code. Now, we listen to the model signal when a row is about to be removed and cleanup the item pointers in the list job. While doing so, we must make take into account that the pointer may already be partially destroyed, since only the ProjectBaseItem dtor will call takeRow, at which point the overriden methods in ProjectFolderItem e.g. won't be available anymore. Additionally, it turned out that the fallback for a similar handler of partially destroyed classes in AbstractFileManagerPluginPrivate::jobFinished only removed the job from a copied list, since it was using foreach, and didn't even take the list by reference... Finally, the test is expanded to reliably trigger the crashy behavior explained in the review request on phabricator. M +25 -46 kdevplatform/project/abstractfilemanagerplugin.cpp M +22 -7 kdevplatform/project/filemanagerlistjob.cpp M +3 -3 kdevplatform/project/filemanagerlistjob.h M +18 -0 plugins/genericprojectmanager/tests/test_projectload.cpp https://invent.kde.org/kde/kdevelop/commit/06b526e81f9f9065d1725b4f35985e71dc0dc2e3 -- You are receiving this mail because: You are watching all bug changes.
