summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <[email protected]>2018-05-15 17:46:23 +0200
committerAleix Pol <[email protected]>2018-05-15 17:46:23 +0200
commit6ee190414604f471327fc9613c96f246047d6ac2 (patch)
treea0fc5d8af05f7dc759449d510f6aa9d6e2ffbc5d
parentf2d87ea7f3fb0e2ef34667694064796a3c5f43ad (diff)
Fix crash
When removing resources, remove its references as well. BUG: 392971
-rw-r--r--libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp b/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
index c90fb0f..7cd6dac 100644
--- a/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
+++ b/libdiscover/backends/PackageKitBackend/PackageKitBackend.cpp
@@ -269,6 +269,11 @@ void PackageKitBackend::includePackagesToAdd()
foreach(const auto &pkg, pkgs) {
auto res = m_packages.packages.take(pkg);
if (res) {
+ if (AppPackageKitResource* ares = qobject_cast<AppPackageKitResource*>(res)) {
+ for(const auto &ext: res->extends())
+ m_packages.extendedBy[ext].removeAll(ares);
+ }
+
emit resourceRemoved(res);
res->deleteLater();
}