D14291: Cleanup RemoteAccess buffers on aboutToBeUnbound instead of object destruction

Roman Gilg noreply at phabricator.kde.org
Mon Jul 23 17:15:14 BST 2018


romangg accepted this revision.
romangg added inline comments.
This revision is now accepted and ready to land.

INLINE COMMENTS

> remote_access_interface.cpp:244
>  
> -    QObject::connect(rbuf, &QObject::destroyed, [p, rbuf, resource, &bh] {
> +    QObject::connect(rbuf, &Resource::aboutToBeUnbound, p->q, [p, rbuf, resource, &bh] {
>          if (!p->clientResources.contains(resource)) {

Why `p->q`? Isn't just `p` enough? Or since `getBufferCallback` is static, leave the slot without object relation? Just connect to the functor as before. But in the end that all doesn't matter much.

> remote_access_interface.cpp:251
>          qCDebug(KWAYLAND_SERVER) << "Remote buffer returned, client" << wl_resource_get_id(resource)
>                                                       << ", id" << rbuf->id()
>                                                       << ", fd" << bh.buf->fd();

If the problem is only this call to id(), then maybe one could just hand over this value to the lambda instead of accessing `rbuf`. But connecting to the `aboutToBeUnbound` signal is also fine.

REPOSITORY
  R127 KWayland

BRANCH
  dave

REVISION DETAIL
  https://phabricator.kde.org/D14291

To: davidedmundson, #kwin, romangg
Cc: romangg, kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180723/9a2a6e75/attachment.html>


More information about the Kde-frameworks-devel mailing list