Don't be clever about program termination.
Needs ReviewPublic

Authored by ahartmetz on Apr 5 2016, 10:16 PM.

Details

Reviewers
mart
hein
ivan
Summary

Don't be clever about program termination.

This fixes hangs with current Qt 5.6.

Calling exit() with a QApplication around is not something you
should do. It used to work before Qt 5.6, but currently doesn't
work - it will hang the the main thread. While this should and
maybe will be fixed in Qt, let's also stop taking the risk.
The cause of the hangs seems to be something in the threaded DBus
handling new in Qt 5.6 and involves destructors of global statics.

The signal handler thing is even more risky. There is a concept
of signal handler safe operations, and anything calling into Qt
is probably not a signal safe operation.

Test Plan

You need to be running Qt 5.6. Run kactivitymanagerd in any way and see that it won't terminate. Or just just look at the list of processes in your session.

Diff Detail

Repository
R161 KActivity Manager Service
Lint
Lint Skipped
Unit
Unit Tests Skipped
ahartmetz updated this revision to Diff 3145.Apr 5 2016, 10:16 PM
ahartmetz retitled this revision from to Don't be clever about program termination..
ahartmetz updated this object.
ahartmetz edited the test plan for this revision. (Show Details)
ahartmetz added reviewers: ivan, hein, mart.
ahartmetz set the repository for this revision to R161 KActivity Manager Service.
ahartmetz added a project: KActivities.
ivan edited edge metadata.May 4 2016, 3:41 PM

Sorry, I missed this one.

Can you try whether the latest master works as expected?

p.s. When you submit patches, please do not reformat the code - it makes reading the diff really difficult (pun not intended), and 'arc diff' can easily fail.

ivan added a comment.May 4 2016, 3:43 PM

p.p.s. The 'smart' termination was an attempt to fix the 'Qt SQL has no idea how to properly deinitialize on termination bug' :)