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());
|
ssgTexturePath((char *)path.dir().c_str());
|
||||||
ssgEntity * entity = load_object((char *)path.c_str());
|
ssgEntity * entity = load_object((char *)path.c_str());
|
||||||
if (entity != 0) {
|
if (entity != 0) {
|
||||||
|
// entity->ref();
|
||||||
float ranges[] = {0, _range_m};
|
float ranges[] = {0, _range_m};
|
||||||
ssgRangeSelector * lod = new ssgRangeSelector;
|
ssgRangeSelector * lod = new ssgRangeSelector;
|
||||||
|
lod->ref();
|
||||||
lod->setRanges(ranges, 2);
|
lod->setRanges(ranges, 2);
|
||||||
if (_heading_type == HEADING_BILLBOARD) {
|
if (_heading_type == HEADING_BILLBOARD) {
|
||||||
ssgCutout * cutout = new ssgCutout(false);
|
ssgCutout * cutout = new ssgCutout(false);
|
||||||
|
// cutout->ref();
|
||||||
cutout->addKid(entity);
|
cutout->addKid(entity);
|
||||||
lod->addKid(cutout);
|
lod->addKid(cutout);
|
||||||
} else {
|
} else {
|
||||||
lod->addKid(entity);
|
lod->addKid(entity);
|
||||||
}
|
}
|
||||||
lod->ref();
|
|
||||||
_models.push_back(lod);
|
_models.push_back(lod);
|
||||||
} else {
|
} else {
|
||||||
SG_LOG(SG_INPUT, SG_ALERT, "Failed to load object " << path.str());
|
SG_LOG(SG_INPUT, SG_ALERT, "Failed to load object " << path.str());
|
||||||
|
|
Loading…
Add table
Reference in a new issue