From: Mikko Rasa Date: Tue, 8 Apr 2014 18:31:28 +0000 (+0300) Subject: Also use halt in sighandler X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=31f95d95a1cc7cf17df8de57ea122482d5f4a859;p=r2c2.git Also use halt in sighandler --- diff --git a/source/engineer/engineer.cpp b/source/engineer/engineer.cpp index fb0502d..789c605 100644 --- a/source/engineer/engineer.cpp +++ b/source/engineer/engineer.cpp @@ -365,9 +365,7 @@ void Engineer::sighandler(int sig) { signal(sig, SIG_DFL); IO::print(IO::cerr, "Fatal signal received, terminating\n"); - const map &trains = layout.get_trains(); - for(map::const_iterator i=trains.begin(); i!=trains.end(); ++i) - layout.get_driver().set_loco_speed(i->first, 0); + layout.get_driver().halt(true); layout.get_driver().flush(); raise(sig); }