Fix crash when switching activities.

Authored by hein on Feb 16 2017, 12:54 PM.



What happens:

  • Activity switch calls invalidateFilter on TaskFilterProxyModel, which may remove rows in response.
  • Up the proxy chain, TasksModel may ask LauncherTasksModel to emit dataChanged for its contents in response to the row removal, to cause its own filtering to re-evaluate the launchers for the life cycle logic.
  • This can cause TFPM to do more filtering before invalidateFilter has actually returned, causing trip-ups such as duplicated rows in the proxy.
  • Eventually the corrupted maps cause a memory corruption crash.

This patch changes step 2 to "find the launchers in the TFPM (the
direct source model) and ask for a dataChanged for each". This
costs us a loop and accesses to IsLauncher, but on the other hand
fixes the crash and avoids a lot of filtering and mapping work
between LTM and up to and including TFPM. It's also just better
code to ask for the dataChanged only from the model we need it


Diff Detail

R120 Plasma Workspace
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
hein updated this revision to Diff 11404.Feb 16 2017, 12:54 PM
hein retitled this revision from to Fix crash when switching activities..
hein updated this object.
hein edited the test plan for this revision. (Show Details)
hein added reviewers: Plasma, davidedmundson.
hein added a subscriber: plasma-devel.
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 16 2017, 12:54 PM
davidedmundson accepted this revision.Feb 16 2017, 12:55 PM
davidedmundson edited edge metadata.
This revision is now accepted and ready to land.Feb 16 2017, 12:55 PM
This revision was automatically updated to reflect the committed changes.