┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFrank Reininghaus <[email protected]>2012-08-24 23:21:31 +0200
committerFrank Reininghaus <[email protected]>2012-08-24 23:27:03 +0200
commit09775ec745e825d248c982396ad36a9bd63aa255 (patch)
tree47062f84f3c244a3af1aedef664c3c1f21b8b720 /src
parent2727715cdd8aa738f4b5f0bbcca55a9d249be77b (diff)
Do not crash when finishing inline renaming in unusual ways
The crash was caused by a null pointer dereference when, e.g., minimizing Dolphin. The root cause was that KStandardItemListWidget::closeRoleEditor() was called twice: once when the role editor loses focus, and once again when the window is resized. After m_roleEditor was set to 0, the second call dereferenced this null pointer. I think the best solution is to disconnect from the role editor's signals when the editor is not needed any more by the KStandardItemListWidget. BUG: 304524 FIXED-IN: 4.9.1
Diffstat (limited to 'src')
-rw-r--r--src/kitemviews/kstandarditemlistwidget.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/kitemviews/kstandarditemlistwidget.cpp b/src/kitemviews/kstandarditemlistwidget.cpp
index 3a76f14a2..7ae7e2efc 100644
--- a/src/kitemviews/kstandarditemlistwidget.cpp
+++ b/src/kitemviews/kstandarditemlistwidget.cpp
@@ -594,6 +594,11 @@ void KStandardItemListWidget::editedRoleChanged(const QByteArray& current, const
if (current.isEmpty() || !parent || current != "text") {
if (m_roleEditor) {
emit roleEditingCanceled(index(), current, data().value(current));
+
+ disconnect(m_roleEditor, SIGNAL(roleEditingCanceled(int,QByteArray,QVariant)),
+ this, SLOT(slotRoleEditingCanceled(int,QByteArray,QVariant)));
+ disconnect(m_roleEditor, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
+ this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
m_roleEditor->deleteLater();
m_roleEditor = 0;
}
@@ -1253,6 +1258,11 @@ void KStandardItemListWidget::closeRoleEditor()
// to transfer the keyboard focus back to the KItemListContainer.
scene()->views()[0]->parentWidget()->setFocus();
}
+
+ disconnect(m_roleEditor, SIGNAL(roleEditingCanceled(int,QByteArray,QVariant)),
+ this, SLOT(slotRoleEditingCanceled(int,QByteArray,QVariant)));
+ disconnect(m_roleEditor, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
+ this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
m_roleEditor->deleteLater();
m_roleEditor = 0;
}