diff --git a/ZCppMain/ZMainHead.H b/ZCppMain/ZMainHead.H index 0c933e8..2cb5c29 100644 --- a/ZCppMain/ZMainHead.H +++ b/ZCppMain/ZMainHead.H @@ -2931,13 +2931,13 @@ namespace ZNsMain template class ZtCObjectPtr */ - /*///////////////////////////////////////////////////////// + /*/////////////////////////////////////////////////////////// ■ object 를 heap 에 생성하고, 참조 카운트를 이용하여 관리. -- 2014-07-20 04:49:00 - /////////////////////////////////////////////////////////*/ + ///////////////////////////////////////////////////////////*/ template< typename TType, typename TAllocClass=ZCAllocClass > @@ -2996,26 +2996,34 @@ namespace ZNsMain ZtCObjectNew(const ZtCObjectNew& rhs) { - mp_StTypeRefCnt=rhs.mp_StTypeRefCnt; ++mp_StTypeRefCnt->MI_RefCount; + mp_StTypeRefCnt = rhs.mp_StTypeRefCnt; ++mp_StTypeRefCnt->MI_RefCount; }/* ZtCObjectNew(const ZtCObjectNew& rhs)*/ ~ZtCObjectNew() { - if(--mp_StTypeRefCnt->MI_RefCount<=0) this->ZCAllocator::DeleteMem(mp_StTypeRefCnt); + if(--mp_StTypeRefCnt->MI_RefCount <= 0) + this->ZCAllocator::DeleteMem(mp_StTypeRefCnt); }/* ~ZtCObjectNew()*/ ZtCObjectNew& operator=(const ZtCObjectNew& rhs) { - if(this==&rhs || mp_StTypeRefCnt==rhs.mp_StTypeRefCnt) return *this; + if(this==&rhs || mp_StTypeRefCnt==rhs.mp_StTypeRefCnt) + { return *this; } + /*++++++++++++++++++++++++++++++++++++++++++++++++++*/ #if(0) - mp_StTypeRefCnt->MO_TypeData = rhs.mp_StTypeRefCnt->MO_TypeData; return *this; + mp_StTypeRefCnt->MO_TypeData = + rhs.mp_StTypeRefCnt->MO_TypeData; return *this; #else - if(--mp_StTypeRefCnt->MI_RefCount<=0) this->ZCAllocator::DeleteMem(mp_StTypeRefCnt); + if(--mp_StTypeRefCnt->MI_RefCount <= 0) + this->ZCAllocator::DeleteMem( mp_StTypeRefCnt ); - mp_StTypeRefCnt = rhs.mp_StTypeRefCnt; ++mp_StTypeRefCnt->MI_RefCount; return *this; + mp_StTypeRefCnt = rhs.mp_StTypeRefCnt ; + ++mp_StTypeRefCnt->MI_RefCount ; + + return *this; ///////////////////////// #endif }/* ZtCObjectNew& operator=(const ZtCObjectNew& rhs)*/