Don't release reference if we don't have one.

Fixes a crash seen if Debugger was run on an unsupported architecture, e.g.
x86-64 (for now).
This commit is contained in:
Rene Gollent 2012-08-08 19:58:40 -04:00
parent 74e288401d
commit 6e3918fa63
1 changed files with 5 additions and 1 deletions

View File

@ -239,6 +239,7 @@ DebuggerInterface::DebuggerInterface(team_id teamID)
DebuggerInterface::~DebuggerInterface() DebuggerInterface::~DebuggerInterface()
{ {
if (fArchitecture != NULL)
fArchitecture->ReleaseReference(); fArchitecture->ReleaseReference();
Close(false); Close(false);
@ -251,6 +252,9 @@ status_t
DebuggerInterface::Init() DebuggerInterface::Init()
{ {
// create the architecture // create the architecture
// TODO: this probably needs to be rethought a bit,
// since especially when we eventually support remote debugging,
// the architecture will depend on the target machine, not the host
#ifdef ARCH_x86 #ifdef ARCH_x86
fArchitecture = new(std::nothrow) ArchitectureX86(this); fArchitecture = new(std::nothrow) ArchitectureX86(this);
#else #else