mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-09-11 13:25:42 +03:00
keyboard: prevent UAF in destroy events
This commit is contained in:
parent
c951c4f8a1
commit
c77b60c910
@ -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 New Issue
Block a user