|
From: <ric...@us...> - 2011-09-07 22:46:43
|
Revision: 1094
http://loki-lib.svn.sourceforge.net/loki-lib/?rev=1094&view=rev
Author: rich_sposato
Date: 2011-09-07 22:46:37 +0000 (Wed, 07 Sep 2011)
Log Message:
-----------
Fixed bug 3224518 by adding calls to OnDereference.
Modified Paths:
--------------
trunk/include/loki/SmartPtr.h
Modified: trunk/include/loki/SmartPtr.h
===================================================================
--- trunk/include/loki/SmartPtr.h 2011-09-07 20:04:38 UTC (rev 1093)
+++ trunk/include/loki/SmartPtr.h 2011-09-07 22:46:37 UTC (rev 1094)
@@ -983,7 +983,7 @@
static void OnDefault(const P&)
{
// Make it depended on template parameter
- static const bool DependedFalse = sizeof(P*) == 0;
+ static const bool DependedFalse = ( sizeof(P*) == 0 );
LOKI_STATIC_CHECK(DependedFalse, ERROR_This_Policy_Does_Not_Allow_Default_Initialization);
}
@@ -1196,6 +1196,7 @@
(void)helper; // do void cast to remove compiler warning.
// Dynamic casting from T1 to T and saving result in `this''s pointer
PointerType p = dynamic_cast< PointerType >( GetImplRef( rhs ) );
+ KP::OnDereference( p );
GetImplRef( *this ) = OP::Clone( p );
}
@@ -1214,6 +1215,7 @@
(void)helper; // do void cast to remove compiler warning.
// Dynamic casting from T1 to T and saving result in `this''s pointer
PointerType p = dynamic_cast< PointerType >( GetImplRef( rhs ) );
+ KP::OnDereference( p );
GetImplRef( *this ) = OP::Clone( p );
}
@@ -1237,6 +1239,7 @@
SmartPtr(CopyArg& rhs) : SP(rhs), OP(rhs), KP(rhs), CP(rhs)
{
+ KP::OnDereference( GetImpl( rhs ) );
GetImplRef(*this) = OP::Clone(GetImplRef(rhs));
}
@@ -1252,6 +1255,7 @@
SmartPtr(const SmartPtr<T1, OP1, CP1, KP1, SP1, CNP1 >& rhs)
: SP(rhs), OP(rhs), KP(rhs), CP(rhs)
{
+ KP::OnDereference( GetImpl( rhs ) );
GetImplRef(*this) = OP::Clone(GetImplRef(rhs));
}
@@ -1267,6 +1271,7 @@
SmartPtr(SmartPtr<T1, OP1, CP1, KP1, SP1, CNP1 >& rhs)
: SP(rhs), OP(rhs), KP(rhs), CP(rhs)
{
+ KP::OnDereference( GetImpl( rhs ) );
GetImplRef(*this) = OP::Clone(GetImplRef(rhs));
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|