Fix crash when aborting LoadJobs
ClosedPublic

Authored by elvisangelaccio on Oct 23 2016, 3:37 PM.

Details

Summary

LoadJob::onNewEntry() receives an Entry pointer. When we kill a LoadJob, the
libarchive plugin deletes all the emitted entries, so onNewEntry() (which is
queued in the events) gets a pointer that points to already free'ed memory.

This patch just delays the deletion of entries by using deleteLater().
This ensures that all the slots are executed first.

An alternative fix could be using a DirectConnection for the entry ->
onNewEntry connection...

Test Plan

Close Ark while loading the linux tarball with and without patch.

Diff Detail

Repository
R36 Ark
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
elvisangelaccio retitled this revision from to Fix crash when aborting LoadJobs.
elvisangelaccio updated this object.
elvisangelaccio edited the test plan for this revision. (Show Details)
elvisangelaccio added a reviewer: rthomsen.
Restricted Application added a project: Ark. · View Herald TranscriptOct 23 2016, 3:37 PM
Restricted Application added a subscriber: kde-utils-devel. · View Herald Transcript
rthomsen accepted this revision.Nov 1 2016, 8:36 PM
rthomsen edited edge metadata.

Fixes the crash for me :)

This revision is now accepted and ready to land.Nov 1 2016, 8:36 PM
This revision was automatically updated to reflect the committed changes.