Fix panic when wayland display connection breaks
Instead, terminate the thread and consider the clipboard dead. The application can now gracefully deal with the situation. Closes: #52
This commit is contained in:
parent
858419b586
commit
ee63d81a57
3 changed files with 5 additions and 9 deletions
|
|
@ -95,9 +95,7 @@ fn worker_impl(
|
|||
WaylandSource::new(connection, event_queue).insert(loop_handle).unwrap();
|
||||
|
||||
loop {
|
||||
event_loop.dispatch(None, &mut state).unwrap();
|
||||
|
||||
if state.exit {
|
||||
if event_loop.dispatch(None, &mut state).is_err() || state.exit {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue