Fix fd leak from keymap updates
This commit is contained in:
parent
d688c33f23
commit
2aea170962
2 changed files with 7 additions and 0 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
- Fixed clipboard crashing, when seat has neither keyboard nor pointer focus
|
- Fixed clipboard crashing, when seat has neither keyboard nor pointer focus
|
||||||
- Advertise UTF8_STRING mimetype
|
- Advertise UTF8_STRING mimetype
|
||||||
|
- Fixed fd leaking from keymap updates
|
||||||
|
|
||||||
## 0.5.1 -- 2020-07-10
|
## 0.5.1 -- 2020-07-10
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
#![macro_use]
|
#![macro_use]
|
||||||
|
|
||||||
|
use std::fs::File;
|
||||||
use std::io::Result;
|
use std::io::Result;
|
||||||
|
use std::os::unix::io::FromRawFd;
|
||||||
use std::sync::mpsc::Sender;
|
use std::sync::mpsc::Sender;
|
||||||
|
|
||||||
use sctk::reexports::client::protocol::wl_keyboard::Event as KeyboardEvent;
|
use sctk::reexports::client::protocol::wl_keyboard::Event as KeyboardEvent;
|
||||||
|
|
@ -120,6 +122,10 @@ pub fn keyboard_handler(seat: WlSeat, event: KeyboardEvent, mut dispatch_data: D
|
||||||
KeyboardEvent::Leave { .. } => {
|
KeyboardEvent::Leave { .. } => {
|
||||||
dispatch_data.remove_seat(seat);
|
dispatch_data.remove_seat(seat);
|
||||||
}
|
}
|
||||||
|
KeyboardEvent::Keymap { fd, .. } => {
|
||||||
|
// Prevent fd leaking.
|
||||||
|
let _ = unsafe { File::from_raw_fd(fd) };
|
||||||
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue