From: Perttu Ahola Date: Wed, 16 Feb 2011 20:54:07 +0000 (+0200) Subject: Debug stacks will now be printed on Ctrl-C. Also client properly quits on Ctrl-C. X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=fb5ae9a7a5a36211af989ec7cac986880d49e538;p=zefram%2Fminetest%2Fminetest_engine.git Debug stacks will now be printed on Ctrl-C. Also client properly quits on Ctrl-C. --- diff --git a/src/main.cpp b/src/main.cpp index 503439d1..88a258dc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1874,7 +1874,7 @@ int main(int argc, char *argv[]) /* Menu-game loop */ - while(g_device->run()) + while(g_device->run() && kill == false) { // This is used for catching disconnects @@ -1886,7 +1886,7 @@ int main(int argc, char *argv[]) Loop quits when menu returns proper parameters. */ - for(;;) + while(kill == false) { // Cursor can be non-visible when coming from the game device->getCursorControl()->setVisible(true); @@ -2179,7 +2179,7 @@ int main(int argc, char *argv[]) // NOTE: So we have to use getTime() and call run()s between them u32 lasttime = device->getTimer()->getTime(); - while(device->run()) + while(device->run() && kill == false) { if(g_disconnect_requested) { diff --git a/src/porting.cpp b/src/porting.cpp index 50605587..97b02823 100644 --- a/src/porting.cpp +++ b/src/porting.cpp @@ -25,6 +25,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #include "porting.h" #include "config.h" +#include "debug.h" namespace porting { @@ -47,8 +48,13 @@ void sigint_handler(int sig) { if(g_killed == false) { - dstream<