[Lazarus] Does closing a form hide it or free it?

vfclists . vfclists at gmail.com
Sat Nov 5 10:50:32 CET 2016


I have a form I use as database dialog that looks up a list of databases to
connect to and when I close the form I expect it to be closed via caHide so
that I can reuse it with ShowModal later, but it seems to get destroyed
because Screen.FindForm doesn't locate it. The CloseAction is set to caHide.

 if FDatabasesDialog = nil then
    FDatabasesDialog :=
TDatabasesForm(Screen.FindForm(TDatabasesForm.ClassName));
  if FDatabasesDialog = nil then
    FDatabasesDialog := TDatabasesForm.Create(Application);

Is there some fault with this code?

The only reason I can think if is that it could be down to a fault in the
FindForm implementation as the Application object it still present.

It is running on a 1.5 series build on Debian Linux under Qt. I will try it
elsewhere if there are some bugs there.

-- 
Frank Church

=======================
http://devblog.brahmancreations.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20161105/a89174fb/attachment.html>


More information about the Lazarus mailing list