shellcorona: always use safe containment destruction order

Reason for the change

We clean up the containments safely in unload(), by first deleting the inner panels and desktop views, and then the outer containments.

But in the destructor, we delete the outer containments first, and let them delete the inner ones at their leisure.

This is unsafe (per the comment in the safe teardown code); fix it by unifying on the same teardown ordering in both places, and also first set m_closingDown in the destructor to prevent availableScreenRectChanged() from being inappropriately emitted during destruction.

Adapt shellTest to cover this case.

Test plan

  1. Have a laptop with an external screen plugged into it
  2. Put at least one panel on each screen
  3. Run systemctl restart --user plasma-plasmashell.service

Bugs fixed

BUG: 515234
FIXED-IN: 6.6.6

Edited by Nate Graham

Merge request reports

Loading
Loading