[Lazarus] GUI multithreaded Win32 program sometimes freeze when quitting

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Lazarus] GUI multithreaded Win32 program sometimes freeze when quitting

Free Pascal - Lazarus mailing list
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
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Lazarus] GUI multithreaded Win32 program sometimes freeze when quitting

Free Pascal - Lazarus mailing list
On 4/18/17, Dennis via Lazarus <[hidden email]> wrote:

> I noticed that it will happen more often if:
> 1)
> constructor TMyComponent.Create(TheOwner : TComponent);
> begin
>
>     self.some_component := TSomeComponent.Create(TheOwner);
> end;

A bit OT, but would think that is bad practice.

Bart
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus
Loading...