No need to additionally ref() subcomponents of a tree. Only the root node
needs to be ref()'d.
This commit is contained in:
parent
dc40db3b33
commit
f1eddc9bf4
1 changed files with 4 additions and 2 deletions
|
@ -159,17 +159,19 @@ FGNewMat::Object::load_models () const
|
|||
ssgTexturePath((char *)path.dir().c_str());
|
||||
ssgEntity * entity = load_object((char *)path.c_str());
|
||||
if (entity != 0) {
|
||||
// entity->ref();
|
||||
float ranges[] = {0, _range_m};
|
||||
ssgRangeSelector * lod = new ssgRangeSelector;
|
||||
lod->setRanges(ranges, 2);
|
||||
lod->ref();
|
||||
lod->setRanges(ranges, 2);
|
||||
if (_heading_type == HEADING_BILLBOARD) {
|
||||
ssgCutout * cutout = new ssgCutout(false);
|
||||
// cutout->ref();
|
||||
cutout->addKid(entity);
|
||||
lod->addKid(cutout);
|
||||
} else {
|
||||
lod->addKid(entity);
|
||||
}
|
||||
lod->ref();
|
||||
_models.push_back(lod);
|
||||
} else {
|
||||
SG_LOG(SG_INPUT, SG_ALERT, "Failed to load object " << path.str());
|
||||
|
|
Loading…
Add table
Reference in a new issue