[Lazarus] Application slow shutting down

Susie Nicol susie.k.nicol at gmail.com
Wed Sep 30 10:11:41 CEST 2015

On Wed, Sep 30, 2015 at 7:50 PM, Michael Van Canneyt <michael at freepascal.org
> wrote:

> On Wed, 30 Sep 2015, Susie Nicol wrote:
> Hi
>> I have an application with a main form, and several others whuich are only
>> ever used in modal form.
>> The application is slow to terminate, and I cannot see why.
>> XFCE on Linux complains that the window containing the main form cannot be
>> closed because 'the application may be busy'.
> 1. Are you using threads ?

Hi Michael.

I'm not using threads.

> 2. Do you create a lot of components dynamically that are freed in the
> destructor of the form ?
> Both can cause significant delays.

Very few overall, and I thought they were safely freed. But heaprtc shows
66 unfreed memory blocks, so that is something I shall check tomorrow (it's
late in NZ)

>> I am using Lazarus 1.4.2, 64-bit, Linux XFCE desktop, GTK+2 widget set.
>> Any suggestions about where to look next will be very welcome.
> What I usually do in such case is not use the debugger, but check using
> the strace command-line utility if there is still some activity in the
> application:
> Put a writeln('something') before and after the Application.Terminate, and
> check what happens between the write() commands in strace's output.

Thanks for that ingenious suggestion. A quick check shows nothing happens
between the two write()s, so Application.Terminate is returning
immediately.  There follows 96 thousand lines of output before the program
gets SIGKILL, so I guess that it was pretty busy!

Something for me to get my teeth into at least.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20150930/db567d2f/attachment-0003.html>

More information about the Lazarus mailing list