hallas added a comment.
I think I have finally found the root cause of this. The following events occurs: 1. A FileCopyJob is created and added as a SubJob to CopyJob 2. CopyJob::slotResult is notified 3. CopyJobPrivate::slotResultCopyingFiles is called because it is in state STATE_COPYING_FILES 4. CopyJobPrivate::slotResultErrorCopyingFiles is called bcause the FileCopyJob is reporting an error 5. uiDelegateExtension()->askSkip is called to ask the user how to handle the error 6. The askSkip function starts a modal QDialog and calls exec, this means a new QEventLoop is started and runs. 7. Before the askSkip function returns, CopyJob::slotResult is notified again because a new error occurs on the same FileCopyJob 8. CopyJobPrivate::slotResultCopyingFiles is called because it is in state STATE_COPYING_FILES 9. CopyJobPrivate::slotResultErrorCopyingFiles is called bcause the FileCopyJob is reporting an error 10. uiDelegateExtension()->askSkip is called to ask the user how to handle the error 11. The user responds and the job is cancelled 12. Finally the initial call to askSkip returns but we are now in an inconsistent state because the job that was notified has been deleted So to avoid getting notifications for the same Job while waiting for user feedback I have tried to simply call removeSubJob prior to calling askSkip, since that function disconnects from the result signal. Also removeSubJob will anyway be call after the user has responded. This also means that the problem is in KIO::CopyJob and not i KJob. REPOSITORY R244 KCoreAddons REVISION DETAIL https://phabricator.kde.org/D19170 To: hallas, #frameworks, elvisangelaccio, dfaure Cc: dhaumann, kde-frameworks-devel, michaelh, ngraham, bruns