use a single QML engine
ClosedPublic

Authored by mart on Oct 23 2017, 3:14 PM.

Details

Summary

use a shared qml engine for all ConfigModules in the same process
this avoids some crashes as creating and deleting stuff from
different engines is known to cause crashes in the v4 garbage collection
and is recomended to use a single QQmlEngine per process

Test Plan

normal SystemSettings seems unaffected, plasma mobile systemsettings
which is qml-only now doesn't crash anymore after loading a module
for the second time

currently ported modules used on desktop are

  • desktop theme
  • look and feel
  • sound
  • splash screen
  • boot splash

they all seem to work correctly
i also invite others to test them

Diff Detail

Repository
R296 KDeclarative
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
mart created this revision.Oct 23 2017, 3:14 PM
Restricted Application added projects: Plasma, Frameworks. · View Herald TranscriptOct 23 2017, 3:14 PM
Restricted Application added subscribers: Frameworks, plasma-devel. · View Herald Transcript
davidedmundson added inline comments.
src/quickaddons/configmodule.cpp
106

!!!!!!!!!!!!!!!!!!!!!!!!!!

mart added inline comments.Oct 23 2017, 8:10 PM
src/quickaddons/configmodule.cpp
106

right, since it keeps track of attached properties in this way, either gets changed or is not possible to use a single engine, damn :/

hmm, maybe using the rootcontext instead would work

mart updated this revision to Diff 21223.Oct 24 2017, 10:54 AM
  • use the qmlobject's rootcontext instead of the engine as is now shared
mart updated this revision to Diff 21224.Oct 24 2017, 10:55 AM
  • use the qmlobject's rootcontext instead of the engine as is now shared
mart added inline comments.Oct 24 2017, 10:56 AM
src/quickaddons/configmodule.cpp
106

this version now should work, as the context is used now: the way the static attached property function finds it is quite an heuristic, but should be 100% reliable

Given the fallout we had when we made the similar change in Plasma, please don't merge until the start of the next release cycle.

Can you expand your "normal system settings seems unaffected" into something more thorough with a list of the relevant KCMs.

mart added a comment.Oct 24 2017, 11:04 AM

Given the fallout we had when we made the similar change in Plasma, please don't merge until the start of the next release cycle.

after november first week release? ok

Can you expand your "normal system settings seems unaffected" into something more thorough with a list of the relevant KCMs.

currently ported modules are

  • desktop theme
  • look and feel
  • sound
  • splash screen
  • boot splash
mart edited the test plan for this revision. (Show Details)Oct 24 2017, 11:05 AM
davidedmundson accepted this revision.Nov 21 2017, 12:27 PM
This revision is now accepted and ready to land.Nov 21 2017, 12:27 PM
This revision was automatically updated to reflect the committed changes.