[server] Use deleteLater when a ClientConnection gets destroyed
ClosedPublic

Authored by graesslin on Oct 10 2016, 12:22 PM.

Details

Summary

In the situation that a wl_client gets destroyed while still
wl_resources are around it can happen that one of them calls into the
ClientConnection during the cleanup handling which gets triggered at the
same time. This can then trigger a crash.

This change uses deleteLater for the ClientConnection and sets the hold
wl_client pointer to null instead of deleting directly. So the
ClientConnection is still around while the Resources gets cleaned up.
This is similar to the cleanup of Resource where on unbind the
wl_resource pointer is set to null and the Resource gets delete later.

BUG: 370232
FIXED-IN: 5.28

Diff Detail

Repository
R127 KWayland
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
graesslin updated this revision to Diff 7260.Oct 10 2016, 12:22 PM
graesslin retitled this revision from to [server] Use deleteLater when a ClientConnection gets destroyed.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added reviewers: Plasma, bshah.
Restricted Application added a project: Plasma on Wayland. · View Herald TranscriptOct 10 2016, 12:22 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
sebas accepted this revision.Oct 10 2016, 3:57 PM
sebas added a reviewer: sebas.
This revision is now accepted and ready to land.Oct 10 2016, 3:57 PM
This revision was automatically updated to reflect the committed changes.