diff --git a/src/osgPlugins/flt/GeoSetBuilder.cpp b/src/osgPlugins/flt/GeoSetBuilder.cpp index 3d1cb623b..c42e4696b 100644 --- a/src/osgPlugins/flt/GeoSetBuilder.cpp +++ b/src/osgPlugins/flt/GeoSetBuilder.cpp @@ -73,6 +73,13 @@ void DynGeoSet::append(DynGeoSet* source) break; \ } +DynGeoSet::DynGeoSet():osg::GeoSet() +{ + // disable the attribute delete functor since the vectors contained in DynGeoSet + // will delete the memory for us. + _adf = NULL; +} + void DynGeoSet::setBinding() { VERIFY_DynGeoSet_Binding(_normal_binding, _normalList) @@ -97,20 +104,20 @@ bool DynGeoSet::setLists() { if ((_primLenList.size() > 0) && (_coordList.size() > 0)) { - osg::GeoSet::setPrimLengths(_primLenList.begin()); - osg::GeoSet::setCoords(_coordList.begin()); + setPrimLengths(_primLenList.begin()); + setCoords(_coordList.begin()); if ((_normalList.size() > 0) && (getNormalBinding() != osg::GeoSet::BIND_OFF)) - osg::GeoSet::setNormals(_normalList.begin()); + setNormals(_normalList.begin()); if ((_colorList.size() > 0) && (getColorBinding() != osg::GeoSet::BIND_OFF)) - osg::GeoSet::setColors(_colorList.begin()); + setColors(_colorList.begin()); if ((_tcoordList.size() > 0) && (getTextureBinding() != osg::GeoSet::BIND_OFF)) - osg::GeoSet::setTextureCoords(_tcoordList.begin()); + setTextureCoords(_tcoordList.begin()); return true; } diff --git a/src/osgPlugins/flt/GeoSetBuilder.h b/src/osgPlugins/flt/GeoSetBuilder.h index 236e11195..9dc18d8a1 100644 --- a/src/osgPlugins/flt/GeoSetBuilder.h +++ b/src/osgPlugins/flt/GeoSetBuilder.h @@ -43,7 +43,9 @@ class DynGeoSet : public osg::GeoSet { public: - virtual osg::Object* clone() const { return new DynGeoSet(); } + DynGeoSet(); + + virtual osg::Object* clone() const { return new DynGeoSet(); } virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast(obj)!=NULL; } virtual const char* className() const { return "GeoSet"; }