Y bueno, al parecer las formas realmente equivalentes son estas:
Forma anidada:
Código Delphi
[-]
var
A: TObjetoA;
B: TObjetoB;
begin
A := TObjetoA.Create;
try
B := TObjetoB.Create;
try
finally
B.Free;
end;
finally
A.Free;
end;
end;
Forma compacta:
Código Delphi
[-]
var
A: TObjetoA;
B: TObjetoB;
begin
A := nil;
B := nil;
try
A := TObjetoA.Create;
B := TObjetoB.Create;
finally
A.Free;
B.Free;
end;
end;
Y yo estaba equivocado. Puesto así, el compilador no genera ningún
warning.
// Saludos