<div dir="ltr"><div>Hi </div><div><br></div><div>I have an application with a main form, and several others whuich are only ever used in modal form.</div><div><br></div><div>The application is slow to terminate, and I cannot see why.  The shutdown procedure, simplified a little looks like this: (datamodified a global Boolean; savedata another procedure in the same unit; the SQLcomponents are in a a data module)</div><div><br></div><div>procedure FinishUp;</div><div><br></div><div>begin</div><div>  if datamodified then </div><div>    savedata;</div><div> </div><div> sqltransaction1.commit;</div><div> sqlconnection.close(True);</div><div><br></div><div>Application.Terminate  {line A}</div><div><br></div><div>end;</div><div><br></div><div>The debugger shows me that everything is fine until line A, when the program hangs: often for 15 seconds, sometimes for ever.</div><div><br></div><div>XFCE on Linux complains that the window containing the main form cannot be closed because 'the application may be busy'.</div><div><br></div><div>I have tried to replace line A with 'halt' or 'close' without any difference. The connection to the database is indeed closed.</div><div><br></div><div>I am using Lazarus 1.4.2, 64-bit, Linux XFCE desktop, GTK+2 widget set.</div><div><br></div><div>Any suggestions about where to look next will be very welcome.</div></div>