mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-23 13:25:58 +01:00
Merge pull request #143 from Ongy/signal_remove
fixes use after free caused by signal lists
This commit is contained in:
commit
f4faa731f0
3 changed files with 7 additions and 1 deletions
|
@ -58,6 +58,7 @@ void wlr_input_device_destroy(struct wlr_input_device *dev) {
|
||||||
if (dev->impl && dev->impl->destroy) {
|
if (dev->impl && dev->impl->destroy) {
|
||||||
dev->impl->destroy(dev);
|
dev->impl->destroy(dev);
|
||||||
} else {
|
} else {
|
||||||
|
wl_list_remove(&dev->events.destroy.listener_list);
|
||||||
free(dev);
|
free(dev);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ void wlr_keyboard_destroy(struct wlr_keyboard *kb) {
|
||||||
if (kb && kb->impl && kb->impl->destroy) {
|
if (kb && kb->impl && kb->impl->destroy) {
|
||||||
kb->impl->destroy(kb);
|
kb->impl->destroy(kb);
|
||||||
} else {
|
} else {
|
||||||
|
wl_list_remove(&kb->events.key.listener_list);
|
||||||
free(kb);
|
free(kb);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,10 @@ void wlr_pointer_destroy(struct wlr_pointer *pointer) {
|
||||||
if (pointer && pointer->impl && pointer->impl->destroy) {
|
if (pointer && pointer->impl && pointer->impl->destroy) {
|
||||||
pointer->impl->destroy(pointer);
|
pointer->impl->destroy(pointer);
|
||||||
} else {
|
} else {
|
||||||
|
wl_list_remove(&pointer->events.motion.listener_list);
|
||||||
|
wl_list_remove(&pointer->events.motion_absolute.listener_list);
|
||||||
|
wl_list_remove(&pointer->events.button.listener_list);
|
||||||
|
wl_list_remove(&pointer->events.axis.listener_list);
|
||||||
free(pointer);
|
free(pointer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue