X-Git-Url: http://git.tdb.fi/?p=gldbg.git;a=blobdiff_plain;f=source%2Fgldbg.cpp;h=c13d5cc2fa6bbafb1b42c87b38139cf78fd58c10;hp=4bc169fcd0079abb2f99811a87db777266e4e86f;hb=a34325fadec5b2be003bf9af1f081bfc4c83e8b6;hpb=efd709c6cdac15b7823e80ed64e448003aea835d diff --git a/source/gldbg.cpp b/source/gldbg.cpp index 4bc169f..c13d5cc 100644 --- a/source/gldbg.cpp +++ b/source/gldbg.cpp @@ -20,8 +20,10 @@ using namespace std; GlDbg *GlDbg::instance = 0; GlDbg::GlDbg(int argc, char **argv): + done(false), cmd_interp(*this), process(vector(argv+1, argv+argc)), + sock_fd(-1), buf_offset(0), flushing(false), got_sigchld(false), @@ -56,7 +58,7 @@ int GlDbg::main() printf("Copyright © 2009-2010 Mikkosoft Productions\n"); printf("Type \"help\" for a list of commands\n"); - while(1) + while(!done) tick(); return 0; @@ -179,7 +181,7 @@ void GlDbg::quit(bool force) { if(!force && process.get_state()!=Process::INACTIVE) throw runtime_error("Program is still running"); - exit(0); + done = true; } void GlDbg::tick() @@ -225,7 +227,7 @@ void GlDbg::tick() free(line); } else if(pstate==Process::INACTIVE) - exit(0); + done = true; } }