mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-22 19:49:49 +01:00
keyboard: prevent UAF in destroy events
This commit is contained in:
parent
c951c4f8a1
commit
c77b60c910
2 changed files with 2 additions and 2 deletions
|
@ -23,9 +23,9 @@ CKeyboard::CKeyboard(wlr_keyboard* keeb) : keyboard(keeb) {
|
|||
|
||||
// clang-format off
|
||||
hyprListener_destroy.initCallback(&keeb->base.events.destroy, [this] (void* owner, void* data) {
|
||||
events.destroy.emit();
|
||||
disconnectCallbacks();
|
||||
keyboard = nullptr;
|
||||
events.destroy.emit();
|
||||
}, this, "CKeyboard");
|
||||
|
||||
hyprListener_key.initCallback(&keeb->events.key, [this] (void* owner, void* data) {
|
||||
|
|
|
@ -18,9 +18,9 @@ CVirtualKeyboard::CVirtualKeyboard(SP<CVirtualKeyboardV1Resource> keeb_) : keybo
|
|||
|
||||
// clang-format off
|
||||
hyprListener_destroy.initCallback(&keeb->base.events.destroy, [this] (void* owner, void* data) {
|
||||
events.destroy.emit();
|
||||
disconnectCallbacks();
|
||||
keyboard.reset();
|
||||
events.destroy.emit();
|
||||
}, this, "CVirtualKeyboard");
|
||||
|
||||
hyprListener_key.initCallback(&keeb->events.key, [this] (void* owner, void* data) {
|
||||
|
|
Loading…
Reference in a new issue