From e466360263225e676bf981831ee3b8f9978936b2 Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Fri, 1 Jul 2011 21:45:44 +0000 Subject: [PATCH] Add copy constructor to ValueLoader. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42361 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/debugger/value/ValueLoader.cpp | 15 +++++++++++++++ src/apps/debugger/value/ValueLoader.h | 1 + 2 files changed, 16 insertions(+) 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