From: Mikko Rasa Date: Fri, 28 Jun 2013 19:41:02 +0000 (+0300) Subject: Delete auxiliary objects together with Vehicle3D X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0a370f46322b0d6b804801bed042817fb8f98408;p=r2c2.git Delete auxiliary objects together with Vehicle3D --- diff --git a/source/3d/vehicle.cpp b/source/3d/vehicle.cpp index 38e2fb5..106be97 100644 --- a/source/3d/vehicle.cpp +++ b/source/3d/vehicle.cpp @@ -64,11 +64,20 @@ Vehicle3D::~Vehicle3D() layout.remove_vehicle(*this); layout.get_scene().remove(*this); for(vector::iterator i=axles.begin(); i!=axles.end(); ++i) + { + layout.get_scene().remove(**i); delete *i; + } for(vector::iterator i=bogies.begin(); i!=bogies.end(); ++i) + { + layout.get_scene().remove(**i); delete *i; + } for(vector::iterator i=rods.begin(); i!=rods.end(); ++i) + { + layout.get_scene().remove(**i); delete *i; + } } Vector Vehicle3D::get_node() const