if(!simulate)
trfc_mgr->save("engineer.state");
delete trfc_mgr;
+ delete server;
}
void Engineer::place_train(Train &train)
Application::main();
+ delete root;
delete glc;
delete wnd;
delete dpy;
{
for(map<unsigned, TrackType *>::iterator i=tracks.begin(); i!=tracks.end(); ++i)
delete i->second;
+ for(map<unsigned, LocoType *>::iterator i=locos.begin(); i!=locos.end(); ++i)
+ delete i->second;
}
TrackType &Catalogue::get_track(unsigned art_nr) const
delete i->second;
for(map<unsigned, Locomotive *>::iterator i=locomotives.begin(); i!=locomotives.end(); ++i)
delete i->second;
- close(serial_fd);
+ if(serial_fd>=0)
+ close(serial_fd);
}
void Control::open(const string &dev)
if(debug)
cout<<"W: "<<queue.front()<<'\n';
- queue.front().send(serial_fd);
+ if(serial_fd>=0)
+ queue.front().send(serial_fd);
+ else
+ queue.erase(queue.begin());
}
}
if(unsigned tid=(*i)->get_turnout_id())
new Turnout(control, tid, (*i)->get_type().get_n_routes()>=3);
if(unsigned sid=(*i)->get_sensor_id())
- new Sensor(control, sid);
+ if(!control.get_sensors().count(sid))
+ new Sensor(control, sid);
if(used_tracks.count(*i)==0)
{