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

@ -261,14 +261,6 @@ namespace Loki
*pCount_ = 1; *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) RefCounted(const RefCounted& rhs)
: pCount_(rhs.pCount_) : pCount_(rhs.pCount_)
{} {}
@ -337,16 +329,6 @@ namespace Loki
ThreadingModel<RefCountedMT, MX>::AtomicAssign(*pCount_, 1); 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) RefCountedMT(const RefCountedMT& rhs)
: pCount_(rhs.pCount_) : pCount_(rhs.pCount_)
{} {}
@ -401,12 +383,6 @@ namespace Loki
COMRefCounted() COMRefCounted()
{} {}
COMRefCounted(const P& val)
{
if(val!=0)
val->AddRef();
}
template <class U> template <class U>
COMRefCounted(const COMRefCounted<U>&) COMRefCounted(const COMRefCounted<U>&)
{} {}
@ -446,9 +422,6 @@ namespace Loki
DeepCopy() DeepCopy()
{} {}
DeepCopy( const P & )
{}
template <class P1> template <class P1>
DeepCopy(const DeepCopy<P1>&) DeepCopy(const DeepCopy<P1>&)
{} {}
@ -509,9 +482,6 @@ namespace Loki
RefLinked() RefLinked()
{} {}
RefLinked( const P & )
{}
template <class P1> template <class P1>
RefLinked(const RefLinked<P1>& rhs) RefLinked(const RefLinked<P1>& rhs)
: Private::RefLinkedBase(rhs) : Private::RefLinkedBase(rhs)
@ -545,9 +515,6 @@ namespace Loki
DestructiveCopy() DestructiveCopy()
{} {}
DestructiveCopy( const P & )
{}
template <class P1> template <class P1>
DestructiveCopy(const DestructiveCopy<P1>&) DestructiveCopy(const DestructiveCopy<P1>&)
{} {}
@ -584,9 +551,6 @@ namespace Loki
NoCopy() NoCopy()
{} {}
NoCopy( const P & )
{}
template <class P1> template <class P1>
NoCopy(const NoCopy<P1>&) NoCopy(const NoCopy<P1>&)
{} {}
@ -655,8 +619,6 @@ namespace Loki
/// Well, it's clear what it does :o) /// Well, it's clear what it does :o)
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
template < class P > struct AssertCheck;
template <class P> template <class P>
struct NoCheck struct NoCheck
{ {
@ -667,10 +629,6 @@ namespace Loki
NoCheck(const NoCheck<P1>&) NoCheck(const NoCheck<P1>&)
{} {}
template <class P1>
NoCheck(const AssertCheck<P1>&)
{}
static void OnDefault(const P&) static void OnDefault(const P&)
{} {}
@ -1005,10 +963,10 @@ namespace Loki
{ KP::OnDefault(GetImpl(*this)); } { KP::OnDefault(GetImpl(*this)); }
explicit explicit
SmartPtr(ExplicitArg p) : SP(p), OP(p) SmartPtr(ExplicitArg p) : SP(p)
{ KP::OnInit(GetImpl(*this)); } { KP::OnInit(GetImpl(*this)); }
SmartPtr(ImplicitArg p) : SP(p), OP(p) SmartPtr(ImplicitArg p) : SP(p)
{ KP::OnInit(GetImpl(*this)); } { KP::OnInit(GetImpl(*this)); }
SmartPtr(CopyArg& rhs) SmartPtr(CopyArg& rhs)
@ -1561,7 +1519,11 @@ namespace std
#endif // SMARTPTR_INC_ #endif // SMARTPTR_INC_
// $Log$ // $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 // Revision 1.29 2006/04/05 22:41:43 rich_sposato
// Fixed bug 1459838 using fix made by Thomas Albrecht. (Thanks!) // Fixed bug 1459838 using fix made by Thomas Albrecht. (Thanks!)
// Also added a constructor for NoCheck policy. // Also added a constructor for NoCheck policy.