try
if Assigned(rList.Inst) then rList.Inst.DoSomething;
except
end;
Really????
Better write it like this:
try
if Assigned(rList.Inst) then rList.Inst.DoSomething;
except
// I just shot myself
end;
This usually happens when a noob has already had exceptions which he or she deemed nonsense and so "protected" the code in the wrong place and in the wrong way.
Now Suicide Sue has likely hidden the real error and can not debug it because there is no valid stackframe....
(That's twice I mentioned this today , but Eugene promissed he did not use that and he is not a noob)
The problem with this code is that assigned() can fail: not everything that passes assigned is really assigned. It just means the pointer is not nil.
That pointer can be invalid:use after free.
In this case it is even more suicidal because Assigned is already a protection test. If assigned fails or causes an error, you need to find out why. Not eat it with an empty exception.
Also do not mention FreeAndNil, plz. in this context. It just demonstrates why it is bad.
The real problem is the interface in the record: that is always assigned, but the class that supports that interface can be gone to heaven. Store the class reference, not the interface.