+5
Completed

W511: false positives (Object 'xxx' created in try block

dummzeuch 10 years ago updated by Roman 10 years ago 3
The warning W511: Object 'xxx' created in try block is annoying because it is common practice to write code like this:

bla := nil;
blub := TBlub.Create
try
bla := TBla.Create;
// ...
finally
bla.Free;
blub.Free;
end;

I realize that is is difficult to determine whether the object variable is being initialized with nil (how far in front of the try do we look?) but we need a way to reduce the amount of such warnings otherwise they will just be turned off.

(I am sure I am not the first one to notice this, but I the look up did not find anything.)