[xwl] Avoid deletion of Transfer in signals from Transfer.

Transfer emits "finished" mid way through it's own methods. If we delete
here transfer is left in the middle of methods like Transfer::timeout
with a dangling "this".
This commit is contained in:
David Edmundson 2021-02-05 17:40:19 +00:00
parent 335d9c4192
commit f3d46cee15

View file

@ -281,7 +281,7 @@ void Selection::startTransferToWayland(xcb_atom_t target, qint32 fd)
connect(transfer, &TransferXtoWl::finished, this, [this, transfer]() {
Q_EMIT transferFinished(transfer->timestamp());
delete transfer;
transfer->deleteLater();
m_xToWlTransfers.removeOne(transfer);
endTimeoutTransfersTimer();
});
@ -299,7 +299,7 @@ void Selection::startTransferToX(xcb_selection_request_event_t *event, qint32 fd
// TODO: serialize? see comment below.
// const bool wasActive = (transfer == m_wlToXTransfers[0]);
delete transfer;
transfer->deleteLater();
m_wlToXTransfers.removeOne(transfer);
endTimeoutTransfersTimer();
// if (wasActive && !m_wlToXTransfers.isEmpty()) {