Unload poller's connection thread earlier in teardown
ClosedPublic

Authored by davidedmundson on Oct 14 2017, 5:21 AM.

Details

Summary

KIdleTime is a global static, it's destructor it deletes the backend in
a deleteLater; This is *after* the app has been deleted.

This means we end up deleting Poller's ConnectionThread after the static
QVector managing the ConnectionThreads in the main app has been deleted,
leading to a confusing crash.

We can fix this by deleting the connection thread in unload rather than
the actual object destruction.

This fixes a crash on app close, most notably the recursive drkonqi
crash.

Test Plan

Verified what was happening by subclassing the vector and adding debug
Had the drkonqi crash loop, made this change, no more crashes

Diff Detail

Repository
R130 Frameworks integration plugin using KWayland
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
davidedmundson created this revision.Oct 14 2017, 5:21 AM
Restricted Application added a project: Plasma. · View Herald TranscriptOct 14 2017, 5:21 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
anthonyfieroni added inline comments.
src/idletime/poller.cpp
137 ↗(On Diff #20709)

Registry is deleted at line 129.

davidedmundson added inline comments.Oct 14 2017, 5:58 AM
src/idletime/poller.cpp
137 ↗(On Diff #20709)

well spotted. Thanks

davidedmundson marked 2 inline comments as done.Oct 14 2017, 5:59 AM
graesslin accepted this revision.Oct 14 2017, 12:45 PM
This revision is now accepted and ready to land.Oct 14 2017, 12:45 PM
This revision was automatically updated to reflect the committed changes.