Fix a crash in Ark
Review Request #104623 - Created April 16, 2012 and discarded
This patch fixes a crash in Ark when Ark is closed while loading a big archive by ensuring that Archive::m_iface is always the last child of Archive so that it gets deleted last. Otherwise, a Job tries to call methods on a deleted ReadOnlyArchiveInterface and the program crashes.
Thanks for the patch. This approach is a workaround that doesn't completely solve the problem -- part of the solution I've been playing with involves simply making the Job-returning methods in Archive make the Jobs children of ArchiveInterface itself, so that they are deleted before their parent. While this solves the current crashes, it causes another crash for CliInterface-derived plugins and makes the others continue running instead of stopping. If you have the time, it's worth looking at the 4-patch series posted to the kdeutils group by Michal Sciubidlo addressing this same bug; while the patches currently don't apply anymore and Michal seems to have disappeared, some of his ideas are still valid. By the way, can you please add the kdeutils group to this review request?