Skip to content
Snippets Groups Projects
Commit d31102cd authored by jkito's avatar jkito :skull:
Browse files

Revert "Don't run Quit() twice during startup"

This reverts commit b9fc3584.

the aboutToQuit signal is emitted just before the app closes and
gives chance to run some teardown routines, when closing the app
via a keyboard shortcut (cmd+q on macOS) we get this signal  and
the handler stops the firewall and performs other needed cleanup

removing this causes a bug where quiting the app would keep  the
firewall running which results into no internet access
parent 211cb85f
Branches
Tags
1 merge request!243Revert "Don't run Quit() twice during startup"
Pipeline #233364 passed
......@@ -102,7 +102,6 @@ QList<QVariant> getAvailableLocales() {
auto handler = [](int sig) -> void {
printf("\nCatched signal(%d): quitting\n", sig);
Quit();
QApplication::quit();
};
......@@ -136,6 +135,11 @@ int main(int argc, char **argv) {
app.setQuitOnLastWindowClosed(false);
app.setAttribute(Qt::AA_UseHighDpiPixmaps);
QObject::connect(&app, &QApplication::aboutToQuit, []() {
qDebug() << ">>> Quitting, bye!";
Quit();
});
#ifdef OS_WIN
signal(SIGINT, handler);
signal(SIGTERM, handler);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment