mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-12 07:16:19 -05:00
Android service avoid shouldexit timer using all CPU available
This commit is contained in:
parent
3e5ed6af9e
commit
5a63ce8e0e
1 changed files with 4 additions and 1 deletions
|
|
@ -60,7 +60,10 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
ApiServerLocal apiServerLocal(&api, sockPath); (void) apiServerLocal;
|
ApiServerLocal apiServerLocal(&api, sockPath); (void) apiServerLocal;
|
||||||
|
|
||||||
|
// This ugly but RsControlModule has no other way to callback for stop
|
||||||
QTimer shouldExitTimer;
|
QTimer shouldExitTimer;
|
||||||
|
shouldExitTimer.setTimerType(Qt::VeryCoarseTimer);
|
||||||
|
shouldExitTimer.setInterval(1000);
|
||||||
QObject::connect( &shouldExitTimer, &QTimer::timeout, [&](){
|
QObject::connect( &shouldExitTimer, &QTimer::timeout, [&](){
|
||||||
if(ctrl_mod.processShouldExit()) app.quit(); } );
|
if(ctrl_mod.processShouldExit()) app.quit(); } );
|
||||||
shouldExitTimer.start();
|
shouldExitTimer.start();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue