summaryrefslogtreecommitdiffstats
path: root/src/ingen
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-06-12 23:45:12 +0000
committerDavid Robillard <d@drobilla.net>2012-06-12 23:45:12 +0000
commitbd83a49443a9ad64155794f4c85d6829ab678bf9 (patch)
tree5c84956c63070c651cec4149b785a4815dfc1dbc /src/ingen
parentca397ba278f703a0674a853dac87c3940b618e58 (diff)
downloadingen-bd83a49443a9ad64155794f4c85d6829ab678bf9.tar.gz
ingen-bd83a49443a9ad64155794f4c85d6829ab678bf9.tar.bz2
ingen-bd83a49443a9ad64155794f4c85d6829ab678bf9.zip
Correctly handle termination with GUI running (fix #833).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4498 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/ingen')
-rw-r--r--src/ingen/main.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp
index abf8aa51..847a08f5 100644
--- a/src/ingen/main.cpp
+++ b/src/ingen/main.cpp
@@ -180,6 +180,10 @@ main(int argc, char** argv)
world, engine_interface.get(), path, parent, symbol);
}
+ // Set up signal handlers that will set quit_flag on interrupt
+ signal(SIGINT, ingen_interrupt);
+ signal(SIGTERM, ingen_interrupt);
+
if (conf.option("gui").get_bool()) {
world->run_module("gui");
} else if (conf.option("run").is_valid()) {
@@ -194,12 +198,6 @@ main(int argc, char** argv)
#endif
} else if (world->engine() && !conf.option("gui").get_bool()) {
- // Run main loop
-
- // Set up signal handlers that will set quit_flag on interrupt
- signal(SIGINT, ingen_interrupt);
- signal(SIGTERM, ingen_interrupt);
-
// Run engine main loop until interrupt
while (world->engine()->main_iteration()) {
Glib::usleep(125000); // 1/8 second