commit 2025-08-25 23:34 edit a bit ZtCObjectNew in ZCppMain/ZMainHead.H
This commit is contained in:
@ -2931,13 +2931,13 @@ namespace ZNsMain
|
||||
template<typename TType> 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)*/
|
||||
|
Reference in New Issue
Block a user