Scope dragAndDropActionsChanged to source lifespan

The source can have a different lifespan to the offer being made.
If a source is removed and we get a drag actions changed before the
offer is cancelled we don't want to crash.

Couldn't reproduce locally, but the trace was good.

BUG: 423127
This commit is contained in:
David Edmundson 2020-06-18 11:00:38 +01:00
parent 07369dfee0
commit a664677051

View file

@ -355,7 +355,7 @@ void DataDeviceInterface::updateDragTarget(SurfaceInterface *surface, quint32 se
offer->dndAction(action);
source->dndAction(action);
};
d->drag.targetActionConnection = connect(offer, &DataOfferInterface::dragAndDropActionsChanged, offer, matchOffers);
d->drag.targetActionConnection = connect(offer, &DataOfferInterface::dragAndDropActionsChanged, source, matchOffers);
d->drag.sourceActionConnection = connect(source, &DataSourceInterface::supportedDragAndDropActionsChanged, source, matchOffers);
}
d->client->flush();