[mythtv-commits] Ticket #10843: SignalHandler does not handle SIGTERM and SIGINT when there is no event loop.
MythTV
noreply at mythtv.org
Sun Jun 17 18:20:53 UTC 2012
#10843: SignalHandler does not handle SIGTERM and SIGINT when there is no event
loop.
--------------------------------------+-------------------------
Reporter: danielk | Owner: bierdo
Type: Bug Report - General | Status: new
Priority: minor | Milestone: 0.26
Component: MythTV - General | Version: Master Head
Severity: medium | Keywords:
Ticket locked: 0 |
--------------------------------------+-------------------------
There are really two problems:
1/ A program like mythcomflag/mythtranscode/mythccextractor won't be
running an event loop so the QSocketNotifier will never fire a
handleSignal(). This could be addressed by calling
QCoreApplication::processEvents() periodically.
2/ If you aren't running in a qApp->exec() then
qApp->quit()/qApp->exit(int) doesn't do anything. This could be addressed
by setting a static volatile bool when the program should exit and having
the program check that after calling QCoreApplication::processEvents().
It might also make sense to set the signal handler to the default within
SignalHandler::signalHandler(), then a second SIGKILL or a second SIGINT
would kill the program a less elegantly. This would allow routines where
forget to add the above to to exit. But we probably wouldn't want to do
this right away as we want to identify the places where there is no proper
program exit on a signal and not exiting is one way to do that.
--
Ticket URL: <http://code.mythtv.org/trac/ticket/10843>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center
More information about the mythtv-commits
mailing list