David Edmundson <> changed:

           What    |Removed                     |Added
      Latest Commit|                            |
                   |                            |kage/cfb69e21fb0aad92f40348
                   |                            |7b4c8a75b2b0bc8041
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from David Edmundson <> ---
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(..);

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

You are receiving this mail because:
You are watching all bug changes.

Reply via email to