Simplify input device destruction code

master
nyorain 7 years ago
parent f998bb8299
commit aa20634309

@ -11,11 +11,7 @@ void wlr_keyboard_init(struct wlr_keyboard *kb,
}
void wlr_keyboard_destroy(struct wlr_keyboard *kb) {
if (!kb) {
return;
}
if (kb->impl && kb->impl->destroy) {
if (kb && kb->impl && kb->impl->destroy) {
kb->impl->destroy(kb);
} else {
free(kb);

@ -14,11 +14,7 @@ void wlr_pointer_init(struct wlr_pointer *pointer,
}
void wlr_pointer_destroy(struct wlr_pointer *pointer) {
if (!pointer) {
return;
}
if (pointer->impl && pointer->impl->destroy) {
if (pointer && pointer->impl && pointer->impl->destroy) {
pointer->impl->destroy(pointer);
} else {
free(pointer);

@ -14,11 +14,7 @@ void wlr_touch_init(struct wlr_touch *touch,
}
void wlr_touch_destroy(struct wlr_touch *touch) {
if (!touch) {
return;
}
if (touch->impl && touch->impl->destroy) {
if (touch && touch->impl && touch->impl->destroy) {
touch->impl->destroy(touch);
} else {
free(touch);

Loading…
Cancel
Save