From 31f95d95a1cc7cf17df8de57ea122482d5f4a859 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 8 Apr 2014 21:31:28 +0300 Subject: [PATCH] Also use halt in sighandler --- source/engineer/engineer.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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); } -- 2.45.2