[server] Standardize the destructor request handling for Resources
ClosedPublic

Authored by graesslin on May 25 2016, 8:09 AM.

Details

Summary

This change standardizes the behavior regarding the destructor request.

The destructor should destroy the resource and nothing else. The
Wayland library invokes the static unbind method once the resource is
destroyed. The implementation provided by Resource::Private::unbind
triggers a delete later on the Resource. So there is no need to trigger
a deleteLater from the destructor request callback.

This change adds a generic implementation to Resource::Private which is
now used by all inheriting classes replacing the custom implementations.

Test Plan

For a few Resources the test is extended to ensure that the Resource
gets deleted on server side.

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 3979.May 25 2016, 8:09 AM
graesslin retitled this revision from to [server] Standardize the destructor request handling for Resources.
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 25 2016, 8:09 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
graesslin updated this revision to Diff 3999.May 25 2016, 1:14 PM

Same for TextInputInterface

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