Guard virtualDesktopManagement being accessed before fetched

Authored by davidedmundson on Feb 15 2019, 2:35 AM.



The WaylandPrivate::virtualDesktopManagement object is loaded

It's null until we finish fetching the registry.

A code path could call the desktopNames in that time.

Test Plan

Had a crash
Couldn't reproduce reliably

Diff Detail

R120 Plasma Workspace
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Feb 15 2019, 2:35 AM
Restricted Application added a project: Plasma. · View Herald TranscriptFeb 15 2019, 2:35 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson requested review of this revision.Feb 15 2019, 2:35 AM

The other option is:


at the end of init, which effectively is a (slightly safer) nested event loop until we've send a ping to kwin and back, which indicates that kwin must have also finished sending the registry

hein accepted this revision.Feb 25 2019, 11:16 AM
hein added a subscriber: hein.

Does the PlasmaWindowManagement object need to be guarded in the same way?

This revision is now accepted and ready to land.Feb 25 2019, 11:16 AM

It would need to be guarded if it was used.

However, from what I can tell it's not an issue there.

All API calls are to objects inside QList<KWayland::Client::PlasmaWindow*>
and if that list is empty it does nothing.

This revision was automatically updated to reflect the committed changes.