aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2021-11-08 00:08:30 -0500
committerGravatar Chris Xiong <chirs241097@gmail.com> 2021-11-08 00:08:30 -0500
commitdd572e4448e577852d2946b4944e260a278c5ef7 (patch)
treeb54916b7f7d41a2abe38c2b80a35797188e43fd7
parent2385b7db19402a18de95d3691ed1bb3dd5333b3b (diff)
downloadQMidiPlayer-dd572e4448e577852d2946b4944e260a278c5ef7.tar.xz
Fix weird crash caused by updating text of invisible labels.
-rw-r--r--simple-visualization/qmpkeyboardwindow.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/simple-visualization/qmpkeyboardwindow.cpp b/simple-visualization/qmpkeyboardwindow.cpp
index b33bb4b..79e5fe3 100644
--- a/simple-visualization/qmpkeyboardwindow.cpp
+++ b/simple-visualization/qmpkeyboardwindow.cpp
@@ -29,6 +29,7 @@ qmpKeyboardWindow::qmpKeyboardWindow(qmpPluginAPI *_api, QWidget *parent):
{
const SEvent *e = (const SEvent *)ee;
int ch = e->type & 0xF;
+ if (!this->isVisible()) return;
if ((e->type & 0xF0) == 0x80 || ((e->type & 0xF0) == 0x90 && e->p2 == 0))
emit keystateupdated(ch, e->p1, false);
if ((e->type & 0xF0) == 0x90 && e->p2 > 0)