]> git.tdb.fi Git - r2c2.git/blobdiff - source/libmarklin/vehicle.cpp
Full vehicle unification
[r2c2.git] / source / libmarklin / vehicle.cpp
index 1f3d3ec178e56a771987264a495b5c20982d80b9..109c3f420d91621a44f427b70fae241669dfce71 100644 (file)
@@ -31,6 +31,10 @@ Vehicle::Vehicle(Layout &l, const VehicleType &t):
 
 Vehicle::~Vehicle()
 {
+       if(next)
+               detach_back();
+       if(prev)
+               detach_front();
        layout.remove_vehicle(*this);
 }