Summary: | Crash when trying to install plasmoid file by dropping it onto a panel | ||
---|---|---|---|
Product: | [Frameworks and Libraries] frameworks-kpackage | Reporter: | Kai Uwe Broulik <kde> |
Component: | default | Assignee: | Marco Martin <notmart> |
Status: | RESOLVED FIXED | ||
Severity: | crash | ||
Priority: | NOR | ||
Version: | 5.24.0 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/kpackage/cfb69e21fb0aad92f403487b4c8a75b2b0bc8041 | Version Fixed In: | |
Sentry Crash Report: |
Description
Kai Uwe Broulik
2016-10-04 19:26:02 UTC
The same exact thing also happens when I use the "Get new widgets" button in Widget Explorer and choose "install from file". It crashes right when I click on the file, I don't even need to finish the dialog. Git commit cfb69e21fb0aad92f403487b4c8a75b2b0bc8041 by David Edmundson. Committed on 16/10/2016 at 12:13. Pushed by davidedmundson into branch 'master'. Fix dangling pointer in KPackageJob A KPackage::Package object uses qexplicitlyshareddata, and it designed to be kept on the stack and copied. However, PackageJob takes a pointer to a package, which it later updates, which is expected to exist for the lifecycle of the job. This means Package p = PackageLoader::self()->loadPackage(..); p.install(); will crash. Given that, I don't think this is an application error, and but a library bug. Both plasmashell installation and uninstallation have this problem: Related: bug 370718 As Package is not a QObject we can't just use a QWeakPointer, and we can't just copy the Package in the packagejob as we need to detatch and update the \*original\* KPackage instance. Also to match behaviour we need to do this without changing any other KPackage instances sharing the same shareddata. Not a neat fix at all, but there aren't many options that work without breaking API or behaviour. REVIEW: 129187 M +31 -1 autotests/plasmoidpackagetest.cpp M +1 -0 autotests/plasmoidpackagetest.h M +9 -0 src/kpackage/package.cpp M +20 -0 src/kpackage/private/package_p.h M +12 -1 src/kpackage/private/packagejob.cpp http://commits.kde.org/kpackage/cfb69e21fb0aad92f403487b4c8a75b2b0bc8041 |