* Moved killing/resuming the team to DebuggerInterface::Close().

* Made the TeamDebugger safer for the case that the initialization failed early.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31218 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2009-06-23 23:09:36 +00:00
parent e951f678c2
commit fef6a27d78
3 changed files with 13 additions and 8 deletions

View File

@ -48,17 +48,17 @@ TeamDebugger::~TeamDebugger()
fTerminating = true;
fDebuggerInterface->Close();
fWorker->ShutDown();
if (fDebuggerInterface != NULL)
fDebuggerInterface->Close(fKillTeamOnQuit);
if (fWorker != NULL)
fWorker->ShutDown();
locker.Unlock();
if (fDebugEventListener >= 0)
wait_for_thread(fDebugEventListener, NULL);
if (fKillTeamOnQuit && fTeam != NULL)
kill_team(fTeam->ID());
delete fDebuggerInterface;
delete fWorker;
delete fDebugModel;

View File

@ -237,7 +237,7 @@ DebuggerInterface::~DebuggerInterface()
{
fArchitecture->RemoveReference();
Close();
Close(false);
delete fDebugContextPool;
}
@ -286,8 +286,13 @@ DebuggerInterface::Init()
void
DebuggerInterface::Close()
DebuggerInterface::Close(bool killTeam)
{
if (killTeam)
kill_team(fTeamID);
else if (fNubPort >= 0)
remove_team_debugger(fTeamID);
if (fDebuggerPort >= 0)
delete_port(fDebuggerPort);
}

View File

@ -27,7 +27,7 @@ public:
virtual ~DebuggerInterface();
status_t Init();
void Close();
void Close(bool killTeam);
Architecture* GetArchitecture() const
{ return fArchitecture; }