[Libreoffice-commits] .: extensions/source

Caolán McNamara caolan at kemper.freedesktop.org
Wed Jan 26 12:15:44 PST 2011


 extensions/source/abpilot/datasourcehandling.cxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 2e2cebc360976fd16e6d64b5462ec9aad7cd8b53
Author: An Leenders <an at Fluffy.(none)>
Date:   Tue Jan 25 17:37:59 2011 +0100

    cpp cleanliness: check for assignment to self

diff --git a/extensions/source/abpilot/datasourcehandling.cxx b/extensions/source/abpilot/datasourcehandling.cxx
index 7da3a77..18108bf 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;
     }
 


More information about the Libreoffice-commits mailing list