Cleanup ViewModel a bit and try to fix crash on exit
ClosedPublic

Authored by valeriymalov on Sep 22 2019, 6:32 PM.

Details

Summary

removeTorrent makes changes to torrent list we are currently iterating
on per-item basis, this causees heap-use-after-free in onExit
Just call removeRows which should be functionally the same, but should
delete all items in one batch

CCBUG: 383127

Compact ViewModel::Item::update
Fix a few warnings (0 as nullptr, c-style casts)
Remove useless ViewModel::torrentFromIndex variant
Remove unused headers
add CMakeLists.txt.user to gitignore

Test Plan

build with asan, run & exit, see asan stacktrace before changing onExit

Diff Detail

Repository
R473 KTorrent
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
valeriymalov requested review of this revision.Sep 22 2019, 6:32 PM
valeriymalov created this revision.
stikonas accepted this revision.Sep 22 2019, 9:30 PM
This revision is now accepted and ready to land.Sep 22 2019, 9:30 PM

Should I land it on master or it seems good enough for the stable branch?

Should I land it on master or it seems good enough for the stable branch?

I don't have a strong opinion on this but maybe stable? I neever observed crash on exit but a lot of other people complained. Otherwise, it might take a long time for a fix to reach them.

This revision was automatically updated to reflect the committed changes.