D7078: [server] Fix crash when sending selection to a DDI without a DataSource
Martin Flöser
noreply at phabricator.kde.org
Wed Aug 9 16:19:17 UTC 2017
graesslin added a comment.
In https://phabricator.kde.org/D7078#134111, @davidedmundson wrote:
> Isn't the real bug from that trace here:
>
> datadevice_interface.cpp:204
> void DataDeviceInterface::sendSelection(DataDeviceInterface *other)
> d->createDataOffer(other->selection());
>
> it's valid for other->selection() to be null, so this should be guarded there. If I do that your modified unit test passes.
>
> Guarding inside the method I fear will mask future bugs.
Guarding there would be result in incorrect state. We went into sendSelection because there is a selection. That the source is null doesn't really matter. But we have to inform the DDI which gets the selection which selection there is. If not it still operates on outdated data. So I thought it's better to continue there and ensure the DataOffer is created.
REPOSITORY
R127 KWayland
REVISION DETAIL
https://phabricator.kde.org/D7078
To: graesslin, #kwin, #plasma, #frameworks
Cc: davidedmundson, plasma-devel, leezu, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, eliasp, sebas, apol, mart, hein, lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170809/46caa71d/attachment.html>
More information about the Kde-frameworks-devel
mailing list