Commit 6feeeb10 authored by David Edmundson's avatar David Edmundson
Browse files

[DataOffer] Avoid calls on null DataSource

A DataOffer can slightly outlive a DataSource; a client will still be
told it's deleted but could call a method in a race.

DataOfferInterface correctly checks for source being still valid, but
nothing updates it when it gets deleted.

BUG: 396308
parent 0a07cb25
......@@ -8,6 +8,9 @@
#include "dataoffer_interface.h"
#include "datasource_interface.h"
#include "resource_p.h"
#include <QPointer>
#include <wayland-server.h>
namespace KWaylandServer
......@@ -18,7 +21,7 @@ class Q_DECL_HIDDEN DataOfferInterface::Private : public Resource::Private
Private(AbstractDataSource *source, DataDeviceInterface *parentInterface, DataOfferInterface *q, wl_resource *parentResource);
AbstractDataSource *source;
QPointer<AbstractDataSource> source;
DataDeviceInterface *dataDevice;
// defaults are set to sensible values for < version 3 interfaces
DataDeviceManagerInterface::DnDActions supportedDnDActions = DataDeviceManagerInterface::DnDAction::Copy | DataDeviceManagerInterface::DnDAction::Move;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment