Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 21700000 authored by René J.V. Bertin's avatar René J.V. Bertin

[OS X] avoid crashing KNode when unsubscribing from a group

REVIEW: 124061
parent 210cc2a1
......@@ -172,9 +172,19 @@ void KNCollectionView::removeGroup( KNGroup::Ptr g )
if (!g->listItem())
return;
g->listItem()->setHidden( true ); // work around bug 248256
delete g->listItem();
KNCollectionViewItem *item = g->listItem();
item->setDisabled(true);
item->setHidden( true ); // work around bug 248256
g->setListItem(0);
updateGroup(g);
// after deactivating, hiding the item, removing it from the group and updating the group,
// we let Qt process any events that may be pending because of those actions or because
// the context menu was used to unsubscribe from this group. We do it here rather than
// leaving them for later in KNMainWidget::secureProcessEvents(), when events concerning
// the group item would be sent to it after it was deleted. Occurs on Mac OS X.
qApp->processEvents();
// now it should be safe to delete item.
delete item;
}
......
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