Add context to kcmodule connection to lambdas
ClosedPublic

Authored by davidedmundson on Nov 1 2018, 6:36 PM.

Details

Summary

configModule outlives KCModuleQML.

BUG: 397894

Test Plan

Compiled

Diff Detail

Repository
R295 KCMUtils
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Nov 1 2018, 6:36 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptNov 1 2018, 6:36 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
davidedmundson requested review of this revision.Nov 1 2018, 6:36 PM
broulik accepted this revision.Nov 1 2018, 7:20 PM
This revision is now accepted and ready to land.Nov 1 2018, 7:20 PM
bruns added a subscriber: bruns.Nov 1 2018, 7:22 PM
bruns added inline comments.
src/kcmoduleqml.cpp
74

this is desctructed after d has been deleted, so the signal may be still connected after d is deleted.

Does disconnect(configModule, 0, this, 0) work, when called in the destructor?

davidedmundson added inline comments.Nov 2 2018, 1:04 AM
src/kcmoduleqml.cpp
74

Technically yes, but there's no sane scope for a code path where configModule is emitting anything between deleting d and this.

bruns accepted this revision.Nov 3 2018, 2:53 PM
bruns added inline comments.
src/kcmoduleqml.cpp
74

Thanks for the confirmation, hope nobody finds an insane one ;-)

This revision was automatically updated to reflect the committed changes.