[Lazarus] GUI multithreaded Win32 program sometimes freeze when quitting

Dennis dec12 at avidsoft.com.hk
Tue Apr 18 16:49:08 CEST 2017


I have an win32 multithreaded program written in lazarus 1.7, FPC 3.1.1

 From time to time, when it quits, it will freezes and from the task 
manager, the program will occupies the entire CPU core.

I noticed that it will happen more often if:
1)
constructor TMyComponent.Create(TheOwner : TComponent);
begin

    self.some_component := TSomeComponent.Create(TheOwner);
end;


instead of

constructor TMyComponent.Create(TheOwner : TComponent);
begin

    self.some_component := TSomeComponent.Create(self);
end;


2) if the program executes some methods of a nil object



3) if I don't do a build all when some common units are changed by 
another project.



Since this freezing behaviour does not happen during debugging, I have 
spent months trying to fix it but failed.

Any suggestions are welcome.

Dennis


More information about the Lazarus mailing list