Fix crash when failing to write to a clipboard (#29)
Fix crash when failing to write to a clipboard
This commit is contained in:
parent
05b6dec99c
commit
da2637af29
2 changed files with 5 additions and 1 deletions
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
## Unreleased
|
## Unreleased
|
||||||
|
|
||||||
|
- Crash when failing to write to a clipboard
|
||||||
|
|
||||||
## 0.6.0 -- 2020-10-03
|
## 0.6.0 -- 2020-10-03
|
||||||
|
|
||||||
- Updated smithay-client-toolkit to 0.12
|
- Updated smithay-client-toolkit to 0.12
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,9 @@ macro_rules! handle_store {
|
||||||
vec![MimeType::TextPlainUtf8.to_string(), MimeType::Utf8String.to_string()],
|
vec![MimeType::TextPlainUtf8.to_string(), MimeType::Utf8String.to_string()],
|
||||||
move |event, _| {
|
move |event, _| {
|
||||||
if let $event_ty::Send { mut pipe, .. } = event {
|
if let $event_ty::Send { mut pipe, .. } = event {
|
||||||
write!(pipe, "{}", $contents).unwrap();
|
// If we fail to write here, it means that other side closed the pipe, thus
|
||||||
|
// we can't do anything about it.
|
||||||
|
let _ = write!(pipe, "{}", $contents);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue