Improve the deconstruction of PlasmaWindows
ClosedPublic

Authored by graesslin on May 12 2016, 5:48 AM.

Details

Summary

The protocol is extended by a dedicated destructor request. When a
PlasmaWindow is umapped we no longer destroy the resource directly,
but only send the unmap. The client is then supposed to clean up
(which it already did in that case) and will invoke the destructor.

The PlasmaWindowInterface object will be automatically deleted after
the unmap once all resources bound for it are destroyed.

The tests are extended by two new test cases which triggered protocol
errors on the client side prior to this change.

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 3773.May 12 2016, 5:48 AM
graesslin retitled this revision from to Improve the deconstruction of PlasmaWindows.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptMay 12 2016, 5:48 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
hein added a subscriber: hein.May 12 2016, 7:29 AM
hein added inline comments.
src/server/plasmawindowmanagement_interface.cpp
252

Can window ever be in the list more than once? I tend to dislike removeAll() because it can hide multi-insert code bugs, so if we can use removeOne and have an autotest somehow veryifying the integrity of the list it might be nicer. Minor nitpick though.

graesslin added inline comments.May 12 2016, 8:42 AM
src/server/plasmawindowmanagement_interface.cpp
252

No windows cannot be in it multiple times. It's only insert from one place where a new object is created and added.

So, one could use removeOne and then a Q_ASSERT for contains.

graesslin updated this revision to Diff 3778.May 12 2016, 8:55 AM

use removeOne + Q_ASSERT, also reorder cleanup to have client destroy before server, otherwise crash possible

hein accepted this revision.May 12 2016, 8:56 AM
hein added a reviewer: hein.
This revision is now accepted and ready to land.May 12 2016, 8:56 AM
This revision was automatically updated to reflect the committed changes.