Commit d5a8ea01 authored by catch's avatar catch

Issue #3142893 by hchonov, Raunak.singh, kishor_kolekar, alexpott, tstoeckler,...

Issue #3142893 by hchonov, Raunak.singh, kishor_kolekar, alexpott, tstoeckler, catch, kfritsche, johnwebdev: Memory leak - typed data prototypes for field items are not re-used like intended

(cherry picked from commit ce5d8528)
parent 9892b8d2
......@@ -169,7 +169,15 @@ public function getPropertyInstance(TypedDataInterface $object, $property_name,
$parts[] = json_encode($settings);
}
// Property path for the requested data object.
$parts[] = $object->getPropertyPath() . '.' . $property_name;
$parts[] = $object->getPropertyPath();
// Only property instances of complex data types should be cached by the
// property name, as they represent different properties. Properties of list
// data types are the items of the list and the property name represents
// only the delta in that list and not an unique property, which is why all
// items should use the same prototype.
if ($object instanceof ComplexDataInterface) {
$parts[] = $property_name;
}
$key = implode(':', $parts);
// Create the prototype if needed.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment