On both Qt5 and Gtk2 the project (attached) gives lot of mem leaks, on exit. Run it on Linux Terminal.
Project has 'use heaptrc' flag cheched.
What am I doing wrong?
{ TForm1 }
const
crNiceScrollNone = TCursor(-30);
crNiceScrollUp = TCursor(-31);
crNiceScrollDown = TCursor(-32);
crNiceScrollLeft = TCursor(-33);
crNiceScrollRight = TCursor(-34);
procedure TForm1.FormCreate(Sender: TObject);
begin
FBmp := TPortableNetworkGraphic.Create;
FBmp.LoadFromResourceName(HInstance, 'AB_MOVE');
Cur0:= LoadCursor(HInstance, 'AB_MOVE');
Cur1:= LoadCursor(HInstance, 'AB_MOVE_U');
Cur2:= LoadCursor(HInstance, 'AB_MOVE_D');
Cur3:= LoadCursor(HInstance, 'AB_MOVE_L');
Cur4:= LoadCursor(HInstance, 'AB_MOVE_R');
Screen.Cursors[crNiceScrollNone] := Cur0;
Screen.Cursors[crNiceScrollUp] := Cur1;
Screen.Cursors[crNiceScrollDown] := Cur2;
Screen.Cursors[crNiceScrollLeft] := Cur3;
Screen.Cursors[crNiceScrollRight] := Cur4;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
DestroyCursor(Cur4);
DestroyCursor(Cur3);
DestroyCursor(Cur2);
DestroyCursor(Cur1);
DestroyCursor(Cur0);
FreeAndNil(FBmp);
end;
I tried to remove 'DestroyCursor' lines (LCL does it auto), still the same leaks.