Commit d5a8ea01 authored by catch's avatar catch
Browse files

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
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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.