Menu

#101 TScreen Cursors memory leak

open
nobody
None
5
2002-01-20
2002-01-20
No

File: QForms.pas

TScreen = class(TComponent)
private
...
procedure DestroyCursors; //this line added by IgD
...

procedure TScreen.DestroyCursors;
//this procedure added to patch memory leak by IgD
var
P, Next: PCursorRec;
begin
P := FCursorList;
while (P <> nil) do
begin
QCursor_destroy(P^.Handle);
Next := P^.Next;
Dispose(P);
P := Next;
end;
end;

destructor TScreen.Destroy;
begin
FHintFont.Free;
FForms.Free;
FCustomForms.Free;
FDataModules.Free;
FSaveFocusedList.Free;
DestroyCursors; //this line added by IgD
Classes.AddDataModule := nil;
Classes.RemoveDataModule := nil;
inherited Destroy;
end;

Discussion


Log in to post a comment.

MongoDB Logo MongoDB