From ab3fcb3ea06c8bc9c0908f80f82403af1fc525e3 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 29 Nov 2020 00:01:11 -0500 Subject: [PATCH] Qt: don't copy the result of get_keyboard(). --- OSBindings/Qt/mainwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OSBindings/Qt/mainwindow.cpp b/OSBindings/Qt/mainwindow.cpp index 04138e7fc..5e6b66410 100644 --- a/OSBindings/Qt/mainwindow.cpp +++ b/OSBindings/Qt/mainwindow.cpp @@ -1020,7 +1020,7 @@ bool MainWindow::processEvent(QKeyEvent *event) { const auto keyboardMachine = machine->keyboard_machine(); if(!keyboardMachine) return true; - auto keyboard = keyboardMachine->get_keyboard(); + auto &keyboard = keyboardMachine->get_keyboard(); keyboard.set_key_pressed(*key, event->text().size() ? event->text()[0].toLatin1() : '\0', isPressed); if(keyboard.is_exclusive() || keyboard.observed_keys().find(*key) != keyboard.observed_keys().end()) { return false;