Commit 9c683ad5 authored by Kevin Kofler's avatar Kevin Kofler
Browse files

Kompare: KompareListView: Don't delete child items in the tree widget item destructors anymore.

QTreeWidgetItem now does this for us, and if we try to do it ourselves, we cause use-after-free and/or double-free bugs. (This was a regression caused by the K3ListView→QTreeWidget port.)

BUG: 286086
FIXED-IN: 4.1.0 (kdesdk 4.8 Beta 1)

svn path=/trunk/KDE/kdesdk/kompare/; revision=1263233
parent 4b373dc6
...@@ -642,8 +642,6 @@ KompareListViewDiffItem::KompareListViewDiffItem( KompareListView* parent, Kompa ...@@ -642,8 +642,6 @@ KompareListViewDiffItem::KompareListViewDiffItem( KompareListView* parent, Kompa
KompareListViewDiffItem::~KompareListViewDiffItem() KompareListViewDiffItem::~KompareListViewDiffItem()
{ {
m_difference = 0; m_difference = 0;
delete m_sourceItem;
delete m_destItem;
} }
void KompareListViewDiffItem::init() void KompareListViewDiffItem::init()
...@@ -696,14 +694,12 @@ KompareListViewLineContainerItem::KompareListViewLineContainerItem( KompareListV ...@@ -696,14 +694,12 @@ KompareListViewLineContainerItem::KompareListViewLineContainerItem( KompareListV
} }
for( int i = 0; i < lines; i++, line++ ) { for( int i = 0; i < lines; i++, line++ ) {
m_lineItemList.append(new KompareListViewLineItem( this, line, lineAt( i ) ) ); new KompareListViewLineItem( this, line, lineAt( i ) );
} }
} }
KompareListViewLineContainerItem::~KompareListViewLineContainerItem() KompareListViewLineContainerItem::~KompareListViewLineContainerItem()
{ {
delete m_blankLineItem;
qDeleteAll( m_lineItemList );
} }
KompareListViewDiffItem* KompareListViewLineContainerItem::diffItemParent() const KompareListViewDiffItem* KompareListViewLineContainerItem::diffItemParent() const
......
...@@ -215,7 +215,6 @@ private: ...@@ -215,7 +215,6 @@ private:
Diff2::DifferenceString* lineAt( int i ) const; Diff2::DifferenceString* lineAt( int i ) const;
private: private:
QList<KompareListViewLineItem *> m_lineItemList;
KompareListViewBlankLineItem* m_blankLineItem; KompareListViewBlankLineItem* m_blankLineItem;
bool m_isSource; bool m_isSource;
}; };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment