From: Martin Perner Date: Sat, 13 Nov 2010 23:21:06 +0000 (+0100) Subject: sim: replace exit() by flag X-Git-Tag: bootrom_v1~77 X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=calu.git;a=commitdiff_plain;h=9d614879c7ca259c7d0150e87d27e88416c11777 sim: replace exit() by flag which will lead to nearly none memleak --- diff --git a/3b_sim/sim.cpp b/3b_sim/sim.cpp index a5c970f..2102c5a 100644 --- a/3b_sim/sim.cpp +++ b/3b_sim/sim.cpp @@ -76,9 +76,11 @@ vector breakpoints; bool ignoreBreak = false; +bool exitProg = false; + void doExit(const vector&) { - exit(EXIT_SUCCESS); + exitProg = true; } unsigned int convertStringToNum(const std::string& in) @@ -632,7 +634,7 @@ int main(int argc, char* argv[]) Func lastFunc = NULL; - while(1) { + while(!exitProg) { UserInput = Reader.GetLine("> ", Tokens, EndOfInput); if(EndOfInput) { break;