From b69f729e75e319af19c29e5771634c21449f55f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Thu, 24 Jan 2013 21:31:38 +0100 Subject: [PATCH] SceneGraph: thinko in FeatureGroup destructor. FeatureGroup shouldn't delete the features, as all features are deleted in Object destructor anyway and no feature can be created without explicitly attaching it to some Object (and it also cannot be detached). Moreover, when the group contains two features belogning to one object and one feature is added using multiple inheritance, on group destruction the object gets deleted along with the feature, removing also the other feature, which breaks the for cycle in group destructor. --- src/SceneGraph/FeatureGroup.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/SceneGraph/FeatureGroup.h b/src/SceneGraph/FeatureGroup.h index 8a8ddeff3..ad1a94bbb 100644 --- a/src/SceneGraph/FeatureGroup.h +++ b/src/SceneGraph/FeatureGroup.h @@ -47,13 +47,10 @@ class FeatureGroup { /** * @brief Destructor * - * Deletes all features belogning to this group. + * Removes all features belogning to this group, but not deletes them. */ inline virtual ~FeatureGroup() { - for(auto i: features) { - i->_group = nullptr; - delete i; - } + for(auto i: features) i->_group = nullptr; } /** @brief Whether the group is empty */