From 78540e49213ed1a03687d55063816659c9142eba Mon Sep 17 00:00:00 2001 From: David Hallas Date: Mon, 22 Apr 2019 19:40:16 +0200 Subject: Summary: Fixes crash when hiding devices Summary: Fixes crash when hiding devices. The crash is caused by KStandardItem::setDataValue which calls the KStandardItemModel::onItemChanged function, and that function will delete the KStandardItem if the data value being set is the hidden attribute being set to true. To fix this KStandardItem now derives QObject so that we can use deleteLater. Test Plan: Right click a device in the places panel and select hide Right click the places panel and select show hidden Right click the hidden device and select show Right click the same device and select hide BUG: 403064 Reviewers: #dolphin, elvisangelaccio Reviewed By: #dolphin, elvisangelaccio Subscribers: kfm-devel Tags: #dolphin Differential Revision: https://phabricator.kde.org/D21050 --- src/kitemviews/kstandarditemmodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/kitemviews/kstandarditemmodel.cpp') diff --git a/src/kitemviews/kstandarditemmodel.cpp b/src/kitemviews/kstandarditemmodel.cpp index a4d42b571..d7307c0bd 100644 --- a/src/kitemviews/kstandarditemmodel.cpp +++ b/src/kitemviews/kstandarditemmodel.cpp @@ -112,7 +112,7 @@ void KStandardItemModel::removeItem(int index) onItemRemoved(index, item); - delete item; + item->deleteLater(); item = nullptr; emit itemsRemoved(KItemRangeList() << KItemRange(index, 1)); -- cgit v1.3.1