Why VirtualDBTreeEx not cleared at form close? lazarus / 31-LCL ---------------------------------------------------------------------- egsuh · 2025-03-27 09:36 I'm trying VirtualDBTreeEx, but it is not destroyed clearly. I don't think I'm doing anything special. The attached image is the first error message. What could possibly go wrong? And how can I edit second, third, etc. columns? I can edit only the first column. ---------------------------------------------------------------------- jamie · 2025-03-27 16:29 Don't you will get much response since there is so many variables in the situation you left out.  1. did you create that DB class at runtime?  2. When closing a form there are many ways, one free's the form! did you forget to free the class you may have created in the onCreate?  3. Normally closing a for free's it, you need to do some cleanup of any items you created at runtime. ---------------------------------------------------------------------- egsuh · 2025-03-28 02:36 Attached is my program. Run it, and press "Refresh", which may take a few seconds. It downloads dataset from my web server. And then terminate the application. Then I see the error messages. ---------------------------------------------------------------------- egsuh · 2025-03-28 04:51 And how can I change the texts in columns, e.g. for TARGET or MAXN fields? I tried to link DBEdits with the fields and changed the values, but the changes were not reflected in VirtualDBTree. ---------------------------------------------------------------------- Zvoni · 2025-03-28 07:28 Quote from: egsuh on March 28, 2025, 03:36:02 amAttached is my program. Run it, and press "Refresh", which may take a few seconds. It downloads dataset from my web server. And then terminate the application. Then I see the error messages. The only thing i see is in TForm1. You create the Frame, but you don't free it. Create an OnClose (or whichever event) for Form1 and free the Frame explicitely there ---------------------------------------------------------------------- egsuh · 2025-03-28 09:20 It doesn't matter. I have assigned owner as self.    frQuota := TfrQuota.Create(self); and even when I destroyed at FormDestroy,     frQuota.Free; the problem does not disappear. ---------------------------------------------------------------------- wp · 2025-03-28 11:26 I am pretty sure that the bug is in the TVirtualDBTreeEx code itself: the component create a FParentField, but never destroys it. I can verify this in a simpler demo project which I am attaching (it compiles with the version of the component from the author's site (https://sourceforge.net/p/virtualdbtreeex/code/ci/default/tree/), I don't know whether it compiles with the OPM version). I contacted the author of the component (matthius). ---------------------------------------------------------------------- jamie · 2025-03-28 17:59 Quote from: wp on March 28, 2025, 12:26:24 pmI am pretty sure that the bug is in the TVirtualDBTreeEx code itself: the component create a FParentField, but never destroys it. I can verify this in a simpler demo project which I am attaching (it compiles with the version of the component from the author's site (https://sourceforge.net/p/virtualdbtreeex/code/ci/default/tree/), I don't know wither it compile with the OPM version). I contacted the author of the component (matthius). I had problems compiling your example, had to remove "Laz.Virtual...." and use just the original Package, not the Laz one. Also at that point I was able to get it to compile and run however, exiting from the app to see the heap trace screen just hangs the debugger and never exits. So I don't know what to say.  I am using 3.2 Laz and 3.2.2 Fpc ---------------------------------------------------------------------- wp · 2025-04-19 11:08 Quote from: wp on March 28, 2025, 12:26:24 pmI am pretty sure that the bug is in the TVirtualDBTreeEx code itself: the component create a FParentField, but never destroys it. [...] I contacted the author of the component (matthius). The current version of the component in OPM does not have the memory leak any more.