From 0a370f46322b0d6b804801bed042817fb8f98408 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Fri, 28 Jun 2013 22:41:02 +0300 Subject: [PATCH] Delete auxiliary objects together with Vehicle3D --- source/3d/vehicle.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- 2.45.2