01-12-2020, 07:18 AM
This may be unrelated but it is adviced that when you declare an object, you set its value to nil in onFormCreate
var
s: TBitmap;
onFormCreate
s:=nil;
This is useful in case you do not create the object by
s:= TBitmap.Create;
because when you free the object with
if assigned(s) then FreeAndNil(s);
you will get acces violation since "s" will not have "nil" value and so it will be undetected by "if assigned"
var
s: TBitmap;
onFormCreate
s:=nil;
This is useful in case you do not create the object by
s:= TBitmap.Create;
because when you free the object with
if assigned(s) then FreeAndNil(s);
you will get acces violation since "s" will not have "nil" value and so it will be undetected by "if assigned"