X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Flibmarklin%2Flocomotive.cpp;h=fe236a515f0fa783dbbb0f1e92022c9b86eb0ebb;hb=52cbe8d99669f843f8f75c51128e2748584dd03a;hp=6329196710583014bc76ee80028daf476bb77ef7;hpb=36beacc579d3132642ed4d98ce5a6d99842b5812;p=r2c2.git diff --git a/source/libmarklin/locomotive.cpp b/source/libmarklin/locomotive.cpp index 6329196..fe236a5 100644 --- a/source/libmarklin/locomotive.cpp +++ b/source/libmarklin/locomotive.cpp @@ -17,7 +17,7 @@ Locomotive::Locomotive(Control &c, unsigned a): reverse(false), funcs(0) { - control.add_locomotive(this); + control.add_locomotive(*this); refresh_status(); } @@ -38,7 +38,7 @@ void Locomotive::set_reverse(bool rev) if(speed) { - (new Time::Timer((500+speed*150)*Time::msec))->signal_timeout.connect(sigc::mem_fun(this, &Locomotive::reverse_timeout)); + control.set_timer((500+speed*150)*Time::msec).signal_timeout.connect(sigc::mem_fun(this, &Locomotive::reverse_timeout)); set_speed(0); } else