mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-05 13:19:32 -04:00
Attempt to fix retroshare android service quit
This commit is contained in:
parent
a1311c16c8
commit
9accb2b3d5
1 changed files with 8 additions and 4 deletions
|
@ -18,6 +18,7 @@
|
||||||
|
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QMetaObject>
|
||||||
|
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
# include "util/androiddebug.h"
|
# include "util/androiddebug.h"
|
||||||
|
@ -37,7 +38,7 @@ int main(int argc, char *argv[])
|
||||||
AndroidStdIOCatcher dbg; (void) dbg;
|
AndroidStdIOCatcher dbg; (void) dbg;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
QCoreApplication a(argc, argv);
|
QCoreApplication app(argc, argv);
|
||||||
ApiServer api;
|
ApiServer api;
|
||||||
RsControlModule ctrl_mod(argc, argv, api.getStateTokenServer(), &api, true);
|
RsControlModule ctrl_mod(argc, argv, api.getStateTokenServer(), &api, true);
|
||||||
api.addResourceHandler(
|
api.addResourceHandler(
|
||||||
|
@ -52,11 +53,14 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
while (!ctrl_mod.processShouldExit())
|
while (!ctrl_mod.processShouldExit())
|
||||||
{
|
{
|
||||||
a.processEvents();
|
app.processEvents();
|
||||||
usleep(20000);
|
usleep(20000);
|
||||||
}
|
}
|
||||||
|
|
||||||
QCoreApplication::quit();
|
/* Since QCoreApplication::quit() is a no-op until the event loop has been
|
||||||
|
* started, we need to defer the call until it starts. Thus, we queue a
|
||||||
|
* deferred method call to quit() */
|
||||||
|
QMetaObject::invokeMethod(&app, "quit", Qt::QueuedConnection);
|
||||||
|
|
||||||
return a.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue