[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kexi/kexidb
From:       Jarosław Staniek <staniek () kde ! org>
Date:       2010-10-20 18:53:24
Message-ID: 20101020185325.078B7AC897 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1187917 by staniek:

KexiDB
*add sanity checks to assignment operators



 M  +2 -0      lookupfieldschema.cpp  
 M  +2 -0      transaction.cpp  


--- trunk/koffice/kexi/kexidb/lookupfieldschema.cpp #1187916:1187917
@@ -146,7 +146,9 @@
 
 LookupFieldSchema::RowSource& LookupFieldSchema::RowSource::operator=(const RowSource & other)
 {
+    if (this != &other) {
     *d = *other.d;
+    }
     return *this;
 }
 
--- trunk/koffice/kexi/kexidb/transaction.cpp #1187916:1187917
@@ -97,6 +97,7 @@
 
 Transaction& Transaction::operator=(const Transaction & trans)
 {
+    if (this != &trans) {
     if (m_data) {
         m_data->refcount--;
         Transaction::globalcount--;
@@ -109,6 +110,7 @@
         m_data->refcount++;
         Transaction::globalcount++;
     }
+    }
     return *this;
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic