Guard virtualDesktopManagement being accessed before fetched
ClosedPublic

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

Details

Summary

The WaylandPrivate::virtualDesktopManagement object is loaded
asyncronously.

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

Repository
R120 Plasma Workspace
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 8319
Build 8337: arc lint + arc unit
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:

connection->roundTrip();

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.