From f5b28033c4340614016e7221fd4a02cb64dc3812 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Tue, 2 Mar 2010 08:24:58 +0000 Subject: [PATCH] Remove signal handler as it seems to upset X --- src/Main.cpp | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) diff --git a/src/Main.cpp b/src/Main.cpp index e7aa188..3092b46 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -32,30 +32,6 @@ using namespace boost::filesystem; namespace { IWindowPtr window; - struct sigaction oldSIGINT; - - void clearSignalHandlers() - { - sigaction(SIGINT, &oldSIGINT, NULL); - } - - void SIGINT_handler(int unused) - { - log() << "Caught SIGINT"; - ::window->quit(); - - clearSignalHandlers(); - } - - void setupSignalHandlers() - { - struct sigaction sa; - sa.sa_handler = SIGINT_handler; - sa.sa_flags = 0; - sigemptyset(&sa.sa_mask); - - sigaction(SIGINT, &sa, &oldSIGINT); - } // Options set from command line int newMapWidth = 32; @@ -118,8 +94,6 @@ int main(int argc, char** argv) log() << "Program started"; - setupSignalHandlers(); - try { if (::action == "" || ::mapFile == "") throw runtime_error("Usage: TrainGame (edit|play) [map]"); @@ -129,7 +103,7 @@ int main(int argc, char** argv) IConfigPtr cfg = getConfig(); ::window = makeSDLWindow(); - + IScreenPtr screen; if (::action == "edit") { if (resourceExists(mapFile, "maps")) -- 2.39.2