blob: c72659bc61edcd66f777522874f01309e4259c2c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
commit e10ebb8bd33cf807e2edfa56c465b40f3237102e
Author: Ruben Vandamme <ruben@kmess.org>
Date: Sun Jul 8 10:56:37 2012 +0200
Fix crash in ContactListModel.
* Individually delete every child instead of using qDeleteAll.
* Crash only happens in combination with Qt 4.8.
* See https://bugs.kde.org/show_bug.cgi?id=285951 for similar issue in Amarok.
* See https://bugreports.qt-project.org/browse/QTBUG-22037 for Qt report.
* Many thanks to Bob ("badjar" on kmess.org/board) for providing the fix.
diff --git a/src/model/contactlistmodelitem.cpp b/src/model/contactlistmodelitem.cpp
index 462d555..ac5a6ca 100644
--- a/src/model/contactlistmodelitem.cpp
+++ b/src/model/contactlistmodelitem.cpp
@@ -79,7 +79,11 @@ ContactListModelItem::ContactListModelItem( Group *group, ContactListModelItem *
*/
ContactListModelItem::~ContactListModelItem()
{
- qDeleteAll( childItems_ );
+ while( !childItems_.isEmpty() )
+ {
+ delete childItems_.takeFirst();
+ }
+
childItems_.clear();
// Delete this item from the parent's children
|