sitter created this revision. sitter added a reviewer: broulik. Herald added a project: Plasma. Herald added a subscriber: plasma-devel. sitter requested review of this revision.
REVISION 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. BUG: 413003 TEST PLAN open kinfocenter switch to energy switch away switch to energy no crash REPOSITORY R102 KInfoCenter BRANCH 413003 REVISION DETAIL https://phabricator.kde.org/D26725 AFFECTED FILES Modules/energy/batterymodel.cpp To: sitter, broulik Cc: plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart