From a3b04ab3986879be284400cd130985f9e955dad1 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Sat, 18 Jul 2015 16:32:33 -0400 Subject: [PATCH] Debugger: Fix oversight in TeamDebugger. - In the case where the target team terminates, the subsequent prompt to ask the user what action they wish to take in response needs to take into account the possibility that the UserInterface in question hasn't yet implemented such prompting. Treat such a case as equivalent to asking the debugger to quit. Addresses part of #10292. --- .../debugger/controllers/TeamDebugger.cpp | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/apps/debugger/controllers/TeamDebugger.cpp b/src/apps/debugger/controllers/TeamDebugger.cpp index 395ecb6f9e..90f445e371 100644 --- a/src/apps/debugger/controllers/TeamDebugger.cpp +++ b/src/apps/debugger/controllers/TeamDebugger.cpp @@ -1657,11 +1657,21 @@ TeamDebugger::_HandleTeamDeleted(TeamDeletedEvent* event) message, "Do nothing", "Quit", fCommandLineArgc != 0 ? "Restart team" : NULL); - if (result == 1) - PostMessage(B_QUIT_REQUESTED); - else if (result == 2) { - _SaveSettings(); - fListener->TeamDebuggerRestartRequested(this); + switch (result) { + case 1: + case -1: + { + PostMessage(B_QUIT_REQUESTED); + break; + } + case 2: + { + _SaveSettings(); + fListener->TeamDebuggerRestartRequested(this); + break; + } + default: + break; } return true;