Merge pull request #35 from sophiekovalevsky/exit-gracefully
gui: exits gracefully
This commit is contained in:
commit
a21586c438
@ -17,6 +17,7 @@ static AppWindow *window;
|
|||||||
void sig_handler(int s) {
|
void sig_handler(int s) {
|
||||||
Q_UNUSED(s)
|
Q_UNUSED(s)
|
||||||
window->close();
|
window->close();
|
||||||
|
app->quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
@ -36,6 +37,6 @@ int main(int argc, char *argv[]) {
|
|||||||
app = new QApplication(argc, argv_ext);
|
app = new QApplication(argc, argv_ext);
|
||||||
window = new AppWindow;
|
window = new AppWindow;
|
||||||
signal(SIGINT, sig_handler);
|
signal(SIGINT, sig_handler);
|
||||||
app->exec();
|
auto rc = app->exec();
|
||||||
return 0;
|
return rc;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user