Add safety checks to DataDeviceInterface
It's possible that the Resource got already unbound when calling into clear selection, etc.
This commit is contained in:
parent
91fa946e30
commit
963651632e
1 changed files with 6 additions and 0 deletions
|
@ -174,12 +174,18 @@ void DataDeviceInterface::sendSelection(DataDeviceInterface *other)
|
|||
if (!r) {
|
||||
return;
|
||||
}
|
||||
if (!d->resource) {
|
||||
return;
|
||||
}
|
||||
wl_data_device_send_selection(d->resource, r->resource());
|
||||
}
|
||||
|
||||
void DataDeviceInterface::sendClearSelection()
|
||||
{
|
||||
Q_D();
|
||||
if (!d->resource) {
|
||||
return;
|
||||
}
|
||||
wl_data_device_send_selection(d->resource, nullptr);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue