Browse Source

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.
pull/7/head
Vladimír Vondruš 13 years ago
parent
commit
b69f729e75
  1. 7
      src/SceneGraph/FeatureGroup.h

7
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 */

Loading…
Cancel
Save