Skip to content

Commit

Permalink
fixed crash
Browse files Browse the repository at this point in the history
  • Loading branch information
benapetr committed Dec 9, 2018
1 parent 00971bb commit 29fc4a3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/huggle_ui/uigeneric.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,17 @@ int UiGeneric::MessageBox(QString title, QString text, MessageBoxStyle st, bool
mb->setDefaultButton(QMessageBox::Yes);
return_value = mb->exec();
// This should fix T210604
MainWindow::HuggleMain->ResetKeyStrokeCheck();
if (MainWindow::HuggleMain != nullptr)
MainWindow::HuggleMain->ResetKeyStrokeCheck();
break;
case MessageBoxStyleQuestionAbort:
mb->setIcon(QMessageBox::Question);
mb->setStandardButtons(QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel);
mb->setDefaultButton(QMessageBox::Cancel);
return_value = mb->exec();
// This should fix T210604
MainWindow::HuggleMain->ResetKeyStrokeCheck();
if (MainWindow::HuggleMain != nullptr)
MainWindow::HuggleMain->ResetKeyStrokeCheck();
break;
case MessageBoxStyleNormal:
mb->setIcon(QMessageBox::Information);
Expand All @@ -60,7 +62,8 @@ int UiGeneric::MessageBox(QString title, QString text, MessageBoxStyle st, bool
return_value = mb->exec();
delete mb;
// This should fix T210604
MainWindow::HuggleMain->ResetKeyStrokeCheck();
if (MainWindow::HuggleMain != nullptr)
MainWindow::HuggleMain->ResetKeyStrokeCheck();
}
else
{
Expand Down

0 comments on commit 29fc4a3

Please sign in to comment.