From a4c9b6603ea5576893c93e87a611837f36f0f206 Mon Sep 17 00:00:00 2001 From: wmayer Date: Thu, 30 May 2024 10:17:22 +0200 Subject: [PATCH] Fixes #14349: GeoFeature::getElementTypes causes undefined behaviour --- src/App/GeoFeature.cpp | 2 +- src/App/GeoFeature.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/App/GeoFeature.cpp b/src/App/GeoFeature.cpp index b09323d4d718..5c48f05afeae 100644 --- a/src/App/GeoFeature.cpp +++ b/src/App/GeoFeature.cpp @@ -268,7 +268,7 @@ const std::vector& GeoFeature::searchElementCache(const std::string return none; } -const std::vector& GeoFeature::getElementTypes(bool /*all*/) const +std::vector GeoFeature::getElementTypes(bool /*all*/) const { static std::vector nil; auto prop = getPropertyOfGeometry(); diff --git a/src/App/GeoFeature.h b/src/App/GeoFeature.h index d483a45243d5..aba2d0cb44cb 100644 --- a/src/App/GeoFeature.h +++ b/src/App/GeoFeature.h @@ -177,7 +177,7 @@ class AppExport GeoFeature : public App::DocumentObject virtual DocumentObject *getElementOwner(const Data::MappedName & /*name*/) const {return nullptr;} - virtual const std::vector& getElementTypes(bool all=true) const; + virtual std::vector getElementTypes(bool all=true) const; /// Return the higher level element names of the given element virtual std::vector getHigherElements(const char *name, bool silent=false) const;