Check version before release

This commit is contained in:
Kirill Chibisov 2020-03-09 02:10:07 +03:00
parent b783b2250c
commit 87ac92595b

View file

@ -667,8 +667,10 @@ fn implement_seat(
}
} else if let Some(pointer) = pointer.take() {
// Release old pointer
if pointer.as_ref().version() >= 3 {
pointer.release();
}
}
if capabilities.contains(Capability::Keyboard) {
if keyboard.is_none() {
@ -731,9 +733,11 @@ fn implement_seat(
}
} else if let Some(keyboard) = keyboard.take() {
// Release old keyboard
if keyboard.as_ref().version() >= 3 {
keyboard.release();
}
}
}
_ => (),
},
(),