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

List:       kde-commits
Subject:    koffice/kexi/tableview
From:       Jaroslaw Staniek <js () iidea ! pl>
Date:       2004-11-10 19:31:06
Message-ID: 20041110193106.E6E4316E2B () office ! kde ! org
[Download RAW message or body]

CVS commit by staniek: 

Table View Prop. Buffer
- fixed memory leak and possible crash


  M +10 -0     kexitableviewpropertybuffer.cpp   1.9
  M +14 -1     kexitableviewpropertybuffer.h   1.5


--- koffice/kexi/tableview/kexitableviewpropertybuffer.cpp  #1.8:1.9
@@ -103,4 +103,13 @@ void KexiTableViewPropertyBuffer::slotRe
 void KexiTableViewPropertyBuffer::insert(uint row, KexiPropertyBuffer* buf, bool \
newOne)  {
+        if (!buf || row >= m_buffers.size()) {
+                kexiwarn << "KexiTableViewPropertyBuffer::insert() invalid args: \
rew="<< row<< " buf="<< buf<< endl; +                return;
+        }
+        if (buf->parent() && buf->parent()!=this) {
+                kexiwarn << "KexiTableViewPropertyBuffer::insert() buffer's parent \
must be NULL or this KexiTableViewPropertyBuffer" << endl; +                return;
+        }
+
 //      m_buffers.remove(row);//sanity
 

--- koffice/kexi/tableview/kexitableviewpropertybuffer.h  #1.4:1.5
@@ -81,7 +83,16 @@ class KEXIDATATABLE_EXPORT KexiTableView
                  If there was a buffer at this position before, it will be \
                destroyed. 
                  If \a newOne is true, the property buffer will be marked as newly \
                created, 
-                 simply by adding "newrow" property. */
+                 simply by adding "newrow" property. 
+
+                 The buffer \a buf will be owned by this object, so you should not 
+                 delete this buffer by hand but call removeCurrentPropertyBuffer() 
+                 or remove(uint) instead. 
+                 Note that buffer's parent (QObject::parent()) must be null 
+                 or qual to this KexiTableViewPropertyBuffer object, otherwise this \
method  +                 will fail with a warning.
+                */
                 void insert(uint row, KexiPropertyBuffer* buf, bool newOne = false);
 
+                /*! Removed a buffer at \a row position. */
                 void remove(uint row);
 
@@ -105,4 +116,6 @@ class KEXIDATATABLE_EXPORT KexiTableView
                 void slotRefreshRequested();
 
+                void bufferDestroying();
+
         protected:
                 KexiPropertyBuffer::Vector m_buffers; //!< prop. buffers vector


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

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