From cb5d70219046d178adfbe3d2ff65c89d3e4c5ad4 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Mon, 23 Feb 2009 22:51:01 +0000 Subject: [PATCH] TeamDebugHandler::_HandlerThread(): Remove and delete the team handler in any case, not only when we kill the team, i.e. also when the team just died or we handed it over to another debugger. We can do this, since it is also safe to assume that we won't get any further debug messages from the team after a B_DEBUGGER_MESSAGE_TEAM_DELETED or B_DEBUGGER_MESSAGE_HANDED_OVER. We were leaking (well, keeping) the team handler in those cases, which was a problem in the latter one, since we silently ate all debug messages for the team in case it would be re-attached later. Fixes bug #2942. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29300 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/servers/debug/DebugServer.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/servers/debug/DebugServer.cpp b/src/servers/debug/DebugServer.cpp index d11b687b2b..2e696e161e 100644 --- a/src/servers/debug/DebugServer.cpp +++ b/src/servers/debug/DebugServer.cpp @@ -419,7 +419,6 @@ TeamDebugHandler::_PopMessage(DebugMessage *&message) } // _EnterDebugger - thread_id TeamDebugHandler::_EnterDebugger() { @@ -798,13 +797,13 @@ TeamDebugHandler::_HandlerThread() if (kill) { // kill the team _KillTeam(); - - // remove this handler from the roster and delete it - TeamDebugHandlerRoster::Default()->RemoveHandler(fTeam); - - delete this; } + // remove this handler from the roster and delete it + TeamDebugHandlerRoster::Default()->RemoveHandler(fTeam); + + delete this; + return B_OK; }