kcm context property object is destroyed before the UI
Problem
During shut down, like, KCM page switching or closing the System Settings / KCM Shell app completely, QML based KCMs print lots of errors that kcm
object is null, and so expressions obviously can't read its properties anymore.
For example:
file:///usr/local/kde6/lib/qml/org/kde/kcmutils/SettingHighlighter.qml:36: TypeError: Cannot read property 'defaultsIndicatorsVisible' of null
where SettingsHighlighter uses an unguarded access:
P.SettingHighlighterPrivate {
id: helper
defaultIndicatorVisible: kcm.defaultsIndicatorsVisible
}
Preferred solution
All the QML UI should be destroyed before the backing KCM object is. It just doesn't make sense to let UI running for longer than the lifespan of its backend controller.