Ensure server cleanup on exit only happens if the server actually started up. Fixes #3277

This commit is contained in:
Akshay Joshi
2018-05-11 09:33:09 +01:00
committed by Dave Page
parent e17b62c055
commit 252a9b265b
2 changed files with 3 additions and 1 deletions

View File

@@ -237,7 +237,6 @@ int main(int argc, char * argv[])
exit(1);
}
QObject::connect(server, SIGNAL(finished()), server, SLOT(deleteLater()));
server->start();
// This is a hack to give the server a chance to start and potentially fail. As
@@ -290,6 +289,8 @@ int main(int argc, char * argv[])
done = true;
}
// Ensure the server gets cleaned up later
QObject::connect(server, SIGNAL(finished()), server, SLOT(deleteLater()));
// Generate the app server URL
QString appServerUrl = QString("http://127.0.0.1:%1/?key=%2").arg(port).arg(key);