

Timer (and main loop) is still alive Timer (and main loop) is still alive Timer (and main loop) is still alive Timer (and main loop) is still alive Timer (and main loop) is still alive app->exec() exited - main loop stopped. This should NOT happen if user closed the window. But it does. Remote application finished with exit code 0.

QGuiApplication *app = SailfishApp::application(argc, argv);
app->setQuitOnLastWindowClosed(true);
UDPManager *udp = new UDPManager();
QQuickView *view = SailfishApp::createView();
QObject::connect(app, SIGNAL(lastWindowClosed()), app, SLOT(quit()));
view->rootContext()->setContextProperty("version", QString(VERSION));
view->rootContext()->setContextProperty("udp", udp);
view->setSource(QString("/usr/share/harbour-push2sail/qml/push2sail.qml"));
view->showFullScreen();
res = app->exec(); // stays here even when user swipe down and window closes
delete app;
delete udp;
return res;