Memleak in TCustomIcon.AssignImage
Original Reporter info from Mantis: Martin @martin_frb
-
Reporter name: Martin Friebe
Original Reporter info from Mantis: Martin @martin_frb
- Reporter name: Martin Friebe
Description:
https://forum.lazarus.freepascal.org/index.php/topic,45350.msg320663.html#msg320663
The following leaks. AssignInfo creates a temp object that is not freed.
procedure TForm1.Button5Click(Sender: TObject);
Var
B:TbitMap;
C:TCursorImage;
begin
B := TBitMap.Create;
C := TCursorImage.Create;
B.SetSize(320,240);
B.Canvas.CopyRect(Rect(0,0,319,239),Canvas,Rect(0,0,319,239));{Comment this line, leaks go away}
C.Assign(B); {or comment this line, leaks go away}
B.Free;
C.Free;
end;