diff --git a/src/App/Link.cpp b/src/App/Link.cpp
index de37eeef2d..624d77286a 100644
--- a/src/App/Link.cpp
+++ b/src/App/Link.cpp
@@ -34,6 +34,7 @@
#include "Link.h"
#include "LinkBaseExtensionPy.h"
#include
+#include
#include "ComplexGeoData.h"
#include "ComplexGeoDataPy.h"
@@ -1421,14 +1422,21 @@ static bool isExcludedProperties(const char *name) {
}
Property *LinkBaseExtension::extensionGetPropertyByName(const char* name) const {
- auto prop = inherited::extensionGetPropertyByName(name);
- if(prop || isExcludedProperties(name))
- return prop;
+ if (checkingProperty)
+ return inherited::extensionGetPropertyByName(name);
+ Base::StateLocker guard(checkingProperty);
+ if(isExcludedProperties(name))
+ return nullptr;
auto owner = getContainer();
- if(owner && owner->canLinkProperties()) {
- auto linked = getTrueLinkedObject(true);
- if(linked)
- return linked->getPropertyByName(name);
+ if (owner) {
+ App::Property *prop = owner->getPropertyByName(name);
+ if(prop)
+ return prop;
+ if(owner->canLinkProperties()) {
+ auto linked = getTrueLinkedObject(true);
+ if(linked)
+ return linked->getPropertyByName(name);
+ }
}
return 0;
}
diff --git a/src/App/Link.h b/src/App/Link.h
index 25edbf1e8b..ff06365ad9 100644
--- a/src/App/Link.h
+++ b/src/App/Link.h
@@ -319,6 +319,8 @@ protected:
mutable bool enableLabelCache;
bool hasOldSubElement;
+
+ mutable bool checkingProperty = false;
};
///////////////////////////////////////////////////////////////////////////