summaryrefslogtreecommitdiff
path: root/community/kmess/fix-crash-in-contactlistmodel.patch
diff options
context:
space:
mode:
Diffstat (limited to 'community/kmess/fix-crash-in-contactlistmodel.patch')
-rw-r--r--community/kmess/fix-crash-in-contactlistmodel.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/community/kmess/fix-crash-in-contactlistmodel.patch b/community/kmess/fix-crash-in-contactlistmodel.patch
new file mode 100644
index 000000000..c72659bc6
--- /dev/null
+++ b/community/kmess/fix-crash-in-contactlistmodel.patch
@@ -0,0 +1,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