From a6646770517c71cf9541e22c1f53eb6d41b8b1c8 Mon Sep 17 00:00:00 2001 From: David Edmundson Date: Thu, 18 Jun 2020 11:00:38 +0100 Subject: [PATCH] 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 --- src/wayland/datadevice_interface.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wayland/datadevice_interface.cpp b/src/wayland/datadevice_interface.cpp index 97da3d8a9e..e827f5f701 100644 --- a/src/wayland/datadevice_interface.cpp +++ b/src/wayland/datadevice_interface.cpp @@ -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();