https://bugs.kde.org/show_bug.cgi?id=413003

Harald Sitter <sit...@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Version Fixed In|                            |5.18.0
      Latest Commit|                            |https://commits.kde.org/kin
                   |                            |focenter/764fce4aefbe1567dc
                   |                            |3bfc795f0232fef9df478c
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #15 from Harald Sitter <sit...@kde.org> ---
Git commit 764fce4aefbe1567dc3bfc795f0232fef9df478c by Harald Sitter.
Committed on 17/01/2020 at 13:30.
Pushed by sitter into branch 'Plasma/5.18'.

make sure Solid::Battery is not deleted from QML

Summary:
Battery objects are casted DeviceInterface objects and those are
owned by Solid. deleting them outside solid means they will end
up as dangling pointers inside Solid's global static objects.

when switching away from the energy KCM the qml engine would
get cleaned up as part of the KCM destruction, qml would then
sweep up the Battery object and corrupt the solid internal
pointers.

to prevent this, explicitly mark Battery objects we give to QML
as owned on the c++ side.
FIXED-IN: 5.18.0

Test Plan:
open kinfocenter
switch to energy
switch away
switch to energy
no crash

Reviewers: broulik, davidedmundson

Reviewed By: davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D26725

M  +6    -1    Modules/energy/batterymodel.cpp

https://commits.kde.org/kinfocenter/764fce4aefbe1567dc3bfc795f0232fef9df478c

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

Reply via email to