tabbox: Do not leak QKeyEvents

Allocate in the stack so it gets cleaned up after using
This commit is contained in:
Aleix Pol 2022-04-12 01:38:30 +02:00 committed by Aleix Pol Gonzalez
parent 992753c24a
commit 1ada1c0652

View file

@ -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);
}
}
}