Skip to content

Commit

Permalink
-debugger/qt: Fixed crash on hard reset.
Browse files Browse the repository at this point in the history
-ui/selmenu.cpp: Dismiss error messages on pressing left or right.
  • Loading branch information
cuavas committed Jul 30, 2024
1 parent b0e8291 commit d32f7e3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
20 changes: 17 additions & 3 deletions src/frontend/mame/ui/selmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1918,7 +1918,11 @@ bool menu_select_launch::handle_keys(u32 flags, int &iptkey)

if (exclusive_input_pressed(iptkey, IPT_UI_CANCEL, 0))
{
if (!m_search.empty())
if (m_ui_error)
{
// dismiss error
}
else if (!m_search.empty())
{
// escape pressed with non-empty search text clears it
m_search.clear();
Expand All @@ -1940,7 +1944,12 @@ bool menu_select_launch::handle_keys(u32 flags, int &iptkey)
// accept left/right keys as-is with repeat
if (exclusive_input_pressed(iptkey, IPT_UI_LEFT, (flags & PROCESS_LR_REPEAT) ? 6 : 0))
{
if (m_focus == focused_menu::RIGHTTOP)
if (m_ui_error)
{
// dismiss error
return false;
}
else if (m_focus == focused_menu::RIGHTTOP)
{
// Swap the right panel and swallow it
iptkey = IPT_INVALID;
Expand Down Expand Up @@ -1971,7 +1980,12 @@ bool menu_select_launch::handle_keys(u32 flags, int &iptkey)
// swallow left/right keys if they are not appropriate
if (exclusive_input_pressed(iptkey, IPT_UI_RIGHT, (flags & PROCESS_LR_REPEAT) ? 6 : 0))
{
if (m_focus == focused_menu::RIGHTTOP)
if (m_ui_error)
{
// dismiss error
return false;
}
else if (m_focus == focused_menu::RIGHTTOP)
{
// Swap the right panel and swallow it
iptkey = IPT_INVALID;
Expand Down
3 changes: 2 additions & 1 deletion src/osd/modules/debugger/qt/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,8 +463,9 @@ void MainWindow::debugActClose()

void MainWindow::debuggerExit()
{
// this isn't called from a Qt event loop, so close() will leak the window object
m_exiting = true;
close();
delete this;
}


Expand Down
3 changes: 2 additions & 1 deletion src/osd/modules/debugger/qt/windowqt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ void WindowQt::debugActQuit()

void WindowQt::debuggerExit()
{
close();
// this isn't called from a Qt event loop, so close() will leak the window object
delete this;
}


Expand Down

0 comments on commit d32f7e3

Please sign in to comment.