undo commit 1.29, reject bug: [ 1459838 ] Loki::COMRefCounted doesn't call AddRef() on assignment

git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@646 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
syntheticpp 2006-05-17 16:04:32 +00:00
parent 79528d3d19
commit e23c99bf65

View file

@ -260,15 +260,7 @@ namespace Loki
assert(pCount_!=0);
*pCount_ = 1;
}
RefCounted( const P & )
: pCount_(static_cast<uintptr_t*>(
SmallObject<>::operator new(sizeof(uintptr_t))))
{
assert(pCount_!=0);
*pCount_ = 1;
}
RefCounted(const RefCounted& rhs)
: pCount_(rhs.pCount_)
{}
@ -337,16 +329,6 @@ namespace Loki
ThreadingModel<RefCountedMT, MX>::AtomicAssign(*pCount_, 1);
}
RefCountedMT( const P & )
{
pCount_ = static_cast<CountPtrType>(
SmallObject<LOKI_DEFAULT_THREADING_NO_OBJ_LEVEL>::operator new(
sizeof(*pCount_)));
assert(pCount_);
//*pCount_ = 1;
ThreadingModel<RefCountedMT, MX>::AtomicAssign(*pCount_, 1);
}
RefCountedMT(const RefCountedMT& rhs)
: pCount_(rhs.pCount_)
{}
@ -400,13 +382,7 @@ namespace Loki
public:
COMRefCounted()
{}
COMRefCounted(const P& val)
{
if(val!=0)
val->AddRef();
}
template <class U>
COMRefCounted(const COMRefCounted<U>&)
{}
@ -445,10 +421,7 @@ namespace Loki
{
DeepCopy()
{}
DeepCopy( const P & )
{}
template <class P1>
DeepCopy(const DeepCopy<P1>&)
{}
@ -508,10 +481,7 @@ namespace Loki
public:
RefLinked()
{}
RefLinked( const P & )
{}
template <class P1>
RefLinked(const RefLinked<P1>& rhs)
: Private::RefLinkedBase(rhs)
@ -544,10 +514,7 @@ namespace Loki
public:
DestructiveCopy()
{}
DestructiveCopy( const P & )
{}
template <class P1>
DestructiveCopy(const DestructiveCopy<P1>&)
{}
@ -583,10 +550,7 @@ namespace Loki
public:
NoCopy()
{}
NoCopy( const P & )
{}
template <class P1>
NoCopy(const NoCopy<P1>&)
{}
@ -655,8 +619,6 @@ namespace Loki
/// Well, it's clear what it does :o)
////////////////////////////////////////////////////////////////////////////////
template < class P > struct AssertCheck;
template <class P>
struct NoCheck
{
@ -667,10 +629,6 @@ namespace Loki
NoCheck(const NoCheck<P1>&)
{}
template <class P1>
NoCheck(const AssertCheck<P1>&)
{}
static void OnDefault(const P&)
{}
@ -1005,10 +963,10 @@ namespace Loki
{ KP::OnDefault(GetImpl(*this)); }
explicit
SmartPtr(ExplicitArg p) : SP(p), OP(p)
SmartPtr(ExplicitArg p) : SP(p)
{ KP::OnInit(GetImpl(*this)); }
SmartPtr(ImplicitArg p) : SP(p), OP(p)
SmartPtr(ImplicitArg p) : SP(p)
{ KP::OnInit(GetImpl(*this)); }
SmartPtr(CopyArg& rhs)
@ -1561,7 +1519,11 @@ namespace std
#endif // SMARTPTR_INC_
// $Log$
// Revision 1.30 2006/05/17 16:04:32 syntheticpp
// undo commit 1.29, reject bug: [ 1459838 ] Loki::COMRefCounted doesn't call AddRef() on assignment
//
// Revision 1.29 2006/04/05 22:41:43 rich_sposato
// Fixed bug 1459838 using fix made by Thomas Albrecht. (Thanks!)
// Also added a constructor for NoCheck policy.