Saving a new entity causes AV in RTTI


When I try saving an entity, an AV in the RTTI is raised.
The call stack clearly indicates that it's coming from the RTTI innards:
When I break, the code is this:

function GetClassInfo(AClass: TClass): PTypeInfo;
    if AClass = nil then
    Result := AClass.ClassInfo;

That you can find in TValue.Make and the cursor is on the result line.
To me this clearly means that something has been freed somewhere it shouldn't have been otherwise the .Classinfo would work.

Going back in the code, Aurelius' RTTI Proxy Wrapper makes a GetValue call which ultimately fails.
Alas, there does not seem to be any sensible way to understand which object is going bad and I wonder if anyone has an idea of how to pinpoint this.



It looks either the object in the proxy, or the parent object holding the proxy field has been destroyed. But it's hard for us to guess, probably you should review your application logic to see if such objects are being destroyed at some point and later being used.