Indeed. C.AddIt() will not be freed in code and results memory leak that i don't know how Delphi handles.

Edit:[pascal] with TClass2(C.AddIt()) do
begin
X := 5.25;
WriteVal();
Free; // Add this and no memory leak
end;[/pascal]

However, because Class2 may have properties that Class1 don't, there may be problems with compatibility. C.AddIt() will only reserve memory for variables in TClass1, anything that goes to TClass2 goes out of its memory.. sort of access violation at least in theory