Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ksInputList memory leak #8

Open
Sniperxx opened this issue May 11, 2022 · 0 comments
Open

ksInputList memory leak #8

Sniperxx opened this issue May 11, 2022 · 0 comments

Comments

@Sniperxx
Copy link

Sniperxx commented May 11, 2022

Hi Graham,
Under Windows and after closing the application a memory leak appear (ksInputList.pas)
after some digging I've found some way to fix this:

destructor TksInputList.Destroy;
...
begin
  FScrollMonitor.Terminate;
  Sleep(300); // Adding this line will fix this problem
...

Sleeping 300 exactly is because the creation of FScrollMonitor thread in the while loop sleeps 200
so after terminating it we have to wait until the thread get out from sleeping and terminates itself..
before code processed to:

  for AItem in FItems do
  begin
    if AItem is TksInputListItemWithControl then
    begin
      c := (AItem as TksInputListItemWithControl).FControl;
      c.parent := nil;
    end;
  end;
@Sniperxx Sniperxx changed the title destructor TksInputList.Destroy; var AItem: TksBaseInputListItem; c: TPresentedControl; begin FScrollMonitor.Terminate; Sleep(300); // Fix ksInputList memory leak May 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant