Skip to content

Commit 91aac05

Browse files
committed
Fixes FreeCAD#14349: GeoFeature::getElementTypes causes undefined behaviour
1 parent 38d4fa3 commit 91aac05

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/App/GeoFeature.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ const std::vector<std::string>& GeoFeature::searchElementCache(const std::string
268268
return none;
269269
}
270270

271-
const std::vector<const char*>& GeoFeature::getElementTypes(bool /*all*/) const
271+
std::vector<const char*> GeoFeature::getElementTypes(bool /*all*/) const
272272
{
273273
static std::vector<const char*> nil;
274274
auto prop = getPropertyOfGeometry();

src/App/GeoFeature.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class AppExport GeoFeature : public App::DocumentObject
177177
virtual DocumentObject *getElementOwner(const Data::MappedName & /*name*/) const
178178
{return nullptr;}
179179

180-
virtual const std::vector<const char *>& getElementTypes(bool all=true) const;
180+
virtual std::vector<const char *> getElementTypes(bool all=true) const;
181181

182182
/// Return the higher level element names of the given element
183183
virtual std::vector<Data::IndexedName> getHigherElements(const char *name, bool silent=false) const;

0 commit comments

Comments
 (0)