Try to fix a leak

pull/4170/head
Kim Kulling 2021-11-11 19:06:25 +01:00
parent a31c979abc
commit 952f0a53c9
2 changed files with 6 additions and 1 deletions

View File

@ -897,7 +897,8 @@ void X3DImporter::readSphere(XmlNode &node) {
StandardShapes::MakeSphere(tess, tlist);
// copy data from temp array and apply scale
for (std::vector<aiVector3D>::iterator it = tlist.begin(); it != tlist.end(); ++it) {
((X3DNodeElementGeometry3D *)ne)->Vertices.push_back(*it * radius);
aiVector3D v = *it;
((X3DNodeElementGeometry3D *)ne)->Vertices.emplace_back(v * radius);
}
((X3DNodeElementGeometry3D *)ne)->Solid = solid;

View File

@ -108,6 +108,10 @@ struct X3DNodeElementBase {
std::list<X3DNodeElementBase *> Children;
X3DElemType Type;
virtual ~X3DNodeElementBase() {
// empty
}
protected:
X3DNodeElementBase(X3DElemType type, X3DNodeElementBase *pParent) :
Parent(pParent), Type(type) {