mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 13:24:15 -05:00
Android service avoid shouldexit timer using all CPU available
This commit is contained in:
parent
3e5ed6af9e
commit
5a63ce8e0e
@ -60,9 +60,12 @@ 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();
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user