diff options
author | An Leenders <an@Fluffy.(none)> | 2011-01-25 17:37:59 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-01-26 20:15:28 +0000 |
commit | 8a4974c5cd9ebc27b64c75dbaa746556e4868923 (patch) | |
tree | b07cc82b3e9e19935786ffbac922152bed3125c5 | |
parent | c37747173d96412a4f4aafbf2e1846c062803391 (diff) |
cpp cleanliness: check for assignment to self
-rw-r--r-- | extensions/source/abpilot/datasourcehandling.cxx | 8 |
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; } |