In den Gettern kommt lediglich der Integer an, der String ist jedoch verschwunden. Kann das etwa mit dem auskommentierten TRttiContext.KeepContext;
zusammenhängen?
Ja, das war der eigentliche Grund für das
KeepContext. Die Ursache konnte ich ad hoc auch nicht ermitteln.
Als Workaround kannst du eine globale Variable vom Typ
TRTTIContext anlegen. Alternativ auch als
class var in einem class helper, dann braucht man auch keinen lokalen
TRTTIContext mehr in
FindAttribute:
Delphi-Quellcode:
type
TCustomAttributeHelper = class helper for TCustomAttribute
public class var
Context: TRttiContext;
end;