<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Sep 30, 2015 at 7:50 PM, Michael Van Canneyt <span dir="ltr"><<a href="mailto:michael@freepascal.org" target="_blank">michael@freepascal.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
<br>
On Wed, 30 Sep 2015, Susie Nicol wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi<br>
<br>
I have an application with a main form, and several others whuich are only<br>
ever used in modal form.<br>
<br>
The application is slow to terminate, and I cannot see why. <br>
XFCE on Linux complains that the window containing the main form cannot be<br>
closed because 'the application may be busy'.<br>
<br>
</blockquote>
<br></span>
1. Are you using threads ?<br></blockquote><div><br></div><div>Hi Michael.<br><br></div><div>I'm not using threads.<br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2. Do you create a lot of components dynamically that are freed in the destructor of the form ?<br>
<br>
Both can cause significant delays.<span class=""><br></span></blockquote><div><br></div><div>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)<br> <br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I am using Lazarus 1.4.2, 64-bit, Linux XFCE desktop, GTK+2 widget set.<br>
<br>
Any suggestions about where to look next will be very welcome.<br>
</blockquote>
<br></span>
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:<br>
<br>
Put a writeln('something') before and after the Application.Terminate, and check what happens between the write() commands in strace's output.<br></blockquote></div><br></div><div class="gmail_extra">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! <br><br></div><div class="gmail_extra">Something for me to get my teeth into at least.<br><br></div><div class="gmail_extra">Thanks<br></div><div class="gmail_extra">Susie<br></div></div>