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:
@@ -239,7 +239,8 @@ DebuggerInterface::DebuggerInterface(team_id teamID)
|
|||||||
|
|
||||||
DebuggerInterface::~DebuggerInterface()
|
DebuggerInterface::~DebuggerInterface()
|
||||||
{
|
{
|
||||||
fArchitecture->ReleaseReference();
|
if (fArchitecture != NULL)
|
||||||
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user