spateln ist immer gut
Delphi-Quellcode:
var
xInterface: IWhatever;
begin
if Assigned(xInterface) then
xInterface := nil;
end;
es sei denn du machsts so
Delphi-Quellcode:
var
xObj: TWhatever;
begin
xObj := TWhatever.Create As IWhatever;
try
finally
FreeAndNil(xObj);
end;
end;