From 1ada1c0652a05133151200e29c2f9945704ff0fd Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 12 Apr 2022 01:38:30 +0200 Subject: [PATCH] tabbox: Do not leak QKeyEvents Allocate in the stack so it gets cleaned up after using --- src/tabbox/tabbox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tabbox/tabbox.cpp b/src/tabbox/tabbox.cpp index 3aeb9ea563..e547f972f7 100644 --- a/src/tabbox/tabbox.cpp +++ b/src/tabbox/tabbox.cpp @@ -1437,8 +1437,8 @@ void TabBox::keyPress(int keyQt) // if Escape is part of the shortcut, don't cancel close(true); } else if (direction == Steady) { - QKeyEvent *event = new QKeyEvent(QEvent::KeyPress, keyQt & ~Qt::KeyboardModifierMask, Qt::NoModifier); - grabbedKeyEvent(event); + QKeyEvent event(QEvent::KeyPress, keyQt & ~Qt::KeyboardModifierMask, Qt::NoModifier); + grabbedKeyEvent(&event); } } }