Skip to content

Commit d32f7e3

Browse files
committed
-debugger/qt: Fixed crash on hard reset.
-ui/selmenu.cpp: Dismiss error messages on pressing left or right.
1 parent b0e8291 commit d32f7e3

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

src/frontend/mame/ui/selmenu.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1918,7 +1918,11 @@ bool menu_select_launch::handle_keys(u32 flags, int &iptkey)
19181918

19191919
if (exclusive_input_pressed(iptkey, IPT_UI_CANCEL, 0))
19201920
{
1921-
if (!m_search.empty())
1921+
if (m_ui_error)
1922+
{
1923+
// dismiss error
1924+
}
1925+
else if (!m_search.empty())
19221926
{
19231927
// escape pressed with non-empty search text clears it
19241928
m_search.clear();
@@ -1940,7 +1944,12 @@ bool menu_select_launch::handle_keys(u32 flags, int &iptkey)
19401944
// accept left/right keys as-is with repeat
19411945
if (exclusive_input_pressed(iptkey, IPT_UI_LEFT, (flags & PROCESS_LR_REPEAT) ? 6 : 0))
19421946
{
1943-
if (m_focus == focused_menu::RIGHTTOP)
1947+
if (m_ui_error)
1948+
{
1949+
// dismiss error
1950+
return false;
1951+
}
1952+
else if (m_focus == focused_menu::RIGHTTOP)
19441953
{
19451954
// Swap the right panel and swallow it
19461955
iptkey = IPT_INVALID;
@@ -1971,7 +1980,12 @@ bool menu_select_launch::handle_keys(u32 flags, int &iptkey)
19711980
// swallow left/right keys if they are not appropriate
19721981
if (exclusive_input_pressed(iptkey, IPT_UI_RIGHT, (flags & PROCESS_LR_REPEAT) ? 6 : 0))
19731982
{
1974-
if (m_focus == focused_menu::RIGHTTOP)
1983+
if (m_ui_error)
1984+
{
1985+
// dismiss error
1986+
return false;
1987+
}
1988+
else if (m_focus == focused_menu::RIGHTTOP)
19751989
{
19761990
// Swap the right panel and swallow it
19771991
iptkey = IPT_INVALID;

src/osd/modules/debugger/qt/mainwindow.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,9 @@ void MainWindow::debugActClose()
463463

464464
void MainWindow::debuggerExit()
465465
{
466+
// this isn't called from a Qt event loop, so close() will leak the window object
466467
m_exiting = true;
467-
close();
468+
delete this;
468469
}
469470

470471

src/osd/modules/debugger/qt/windowqt.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ void WindowQt::debugActQuit()
251251

252252
void WindowQt::debuggerExit()
253253
{
254-
close();
254+
// this isn't called from a Qt event loop, so close() will leak the window object
255+
delete this;
255256
}
256257

257258

0 commit comments

Comments
 (0)