diff --git a/src/apps/debugger/value/ValueLoader.cpp b/src/apps/debugger/value/ValueLoader.cpp index d049bceda3..5c6232de65 100644 --- a/src/apps/debugger/value/ValueLoader.cpp +++ b/src/apps/debugger/value/ValueLoader.cpp @@ -33,6 +33,21 @@ ValueLoader::ValueLoader(Architecture* architecture, TeamMemory* teamMemory, } +ValueLoader::ValueLoader(const ValueLoader& other) + : + fArchitecture(other.fArchitecture), + fTeamMemory(other.fTeamMemory), + fTypeInformation(other.fTypeInformation), + fCpuState(other.fCpuState) +{ + fArchitecture->AcquireReference(); + fTeamMemory->AcquireReference(); + fTypeInformation->AcquireReference(); + if (fCpuState != NULL) + fCpuState->AcquireReference(); +} + + ValueLoader::~ValueLoader() { fArchitecture->ReleaseReference(); diff --git a/src/apps/debugger/value/ValueLoader.h b/src/apps/debugger/value/ValueLoader.h index 26d72a6a15..13ac146365 100644 --- a/src/apps/debugger/value/ValueLoader.h +++ b/src/apps/debugger/value/ValueLoader.h @@ -27,6 +27,7 @@ public: TeamTypeInformation* typeInformation, CpuState* cpuState); // cpuState can be NULL + ValueLoader(const ValueLoader& other); ~ValueLoader(); Architecture* GetArchitecture() const