summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAn Leenders <an@Fluffy.(none)>2011-01-25 17:37:59 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-01-26 20:15:28 +0000
commit8a4974c5cd9ebc27b64c75dbaa746556e4868923 (patch)
treeb07cc82b3e9e19935786ffbac922152bed3125c5
parentc37747173d96412a4f4aafbf2e1846c062803391 (diff)
cpp cleanliness: check for assignment to self
-rw-r--r--extensions/source/abpilot/datasourcehandling.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx
index 328f7513fd5f..acce49187c94 100644
--- a/extensions/source/abpilot/datasourcehandling.cxx
+++ b/extensions/source/abpilot/datasourcehandling.cxx
@@ -357,9 +357,11 @@ namespace abp
//---------------------------------------------------------------------
ODataSource& ODataSource::operator=( const ODataSource& _rSource )
{
- delete m_pImpl;
- m_pImpl = new ODataSourceImpl( *_rSource.m_pImpl );
-
+ if( this != &_rSource )
+ {
+ delete m_pImpl;
+ m_pImpl = new ODataSourceImpl( *_rSource.m_pImpl );
+ }
return *this;
}