The crash happens when the following sequence of events occurs:
- A FileCopyJob is created and added as a SubJob to CopyJob
- CopyJob::slotResult is notified
- CopyJobPrivate::slotResultCopyingFiles is called because it is in state STATE_COPYING_FILES
- CopyJobPrivate::slotResultErrorCopyingFiles is called bcause the FileCopyJob is reporting an error
- uiDelegateExtension()->askSkip is called to ask the user how to handle the error
- The askSkip function starts a modal QDialog and calls exec, this means a new QEventLoop is started and runs.
- Before the askSkip function returns, CopyJob::slotResult is notified again because a new error occurs on the same FileCopyJob
- CopyJobPrivate::slotResultCopyingFiles is called because it is in state STATE_COPYING_FILES
- CopyJobPrivate::slotResultErrorCopyingFiles is called bcause the FileCopyJob is reporting an error
- uiDelegateExtension()->askSkip is called to ask the user how to handle the error
- The user responds and the job is cancelled
- Finally the initial call to askSkip returns but we are now in an inconsistent state because the job that was notified has been deleted
To avoid getting notifications for a job while waiting for user feedback simply remove it using removeSubJob prior to calling askSkip.