]> git.mxchange.org Git - flightgear.git/commitdiff
No need to additionally ref() subcomponents of a tree. Only the root node
authorcurt <curt>
Fri, 26 Jul 2002 23:27:53 +0000 (23:27 +0000)
committercurt <curt>
Fri, 26 Jul 2002 23:27:53 +0000 (23:27 +0000)
needs to be ref()'d.

src/Objects/newmat.cxx

index 1b2fcd531ed4910c99382150e9156caf56b7ea8f..e22df26b693dd4e8b92257d23cfc2bd972a16faf 100644 (file)
@@ -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());