diff --git a/src/pushservice.cpp b/src/pushservice.cpp index f1abeba..b9af52a 100644 --- a/src/pushservice.cpp +++ b/src/pushservice.cpp @@ -172,6 +172,16 @@ void preparaPercorsiMotore() } } +namespace { +// QThread::create() arriva in Qt 5.10; qui il target รจ Qt 5.6: il ciclo del +// motore va in una sottoclasse con run(). +class ThreadMotore : public QThread +{ +public: + void run() override { gd_engine_run(); } +}; +} + int risveglioPush(int argc, char *argv[]) { static int uno = 1; @@ -187,8 +197,8 @@ int risveglioPush(int argc, char *argv[]) EngineBridge bridge; EngineBridge::setInstance(&bridge); - QThread *motore = QThread::create([] { gd_engine_run(); }); - motore->start(); + ThreadMotore motore; + motore.start(); // Tetto di sicurezza: un risveglio non deve restare appeso. QTimer::singleShot(60000, &app, [&app]() {