Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 5 of 5 total |
Components not really freed |
Thu, Sep 19 2013 11:12 AM | Permanent Link |
Ronald | Hi,
I came across a problem that I demonstrate in the attachment. I create a TPanel and on that Panel I create 2 Panels (in code). Then I free alle the components on the panel with: for t1:=Panel1.ComponentCount-1 downto 0 do begin aPanel:=TPanel(Panel1.Component[t1]); aPanel.Free; end; But if check the amount of components with: ShowMessage(IntToStr(Panel1.ComponentCount)); Tha amount is still 2. The components are not really gone. Am I doing something wrong? Ronald Attachments: test4.zip |
Thu, Sep 19 2013 11:37 AM | Permanent Link |
Uli Becker | Ronald,
> The components are not really gone. > Am I doing something wrong? I had the same problem. Maybe a bug. I solved it by looping through all components of the form and checking their parent like this: procedure TForm1.ClearPanel(Sender: TObject); var i: integer; c: TComponent; begin for i := componentcount - 1 downto 0 do begin c := component[i]; if TControl(c).parent = sender then c.free; end; end; Regards Uli |
Thu, Sep 19 2013 12:25 PM | Permanent Link |
Ronald | In my actual application the routine "sees" all components that should be
freed and it tries this, but with no result. Is this the garabage collection that is a little late? "Uli Becker" schreef in bericht news:5F62F7AC-0E31-45ED-9F53-C5C62C12FA64@news.elevatesoft.com... Ronald, > The components are not really gone. > Am I doing something wrong? I had the same problem. Maybe a bug. I solved it by looping through all components of the form and checking their parent like this: procedure TForm1.ClearPanel(Sender: TObject); var i: integer; c: TComponent; begin for i := componentcount - 1 downto 0 do begin c := component[i]; if TControl(c).parent = sender then c.free; end; end; Regards Uli |
Mon, Sep 23 2013 1:12 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Ronald,
<< The components are not really gone. Am I doing something wrong? >> No, it's a bug. The panel is setting the destroying flag for the component and that is interfering with it being removed from the components list. A fix will be in the next build. Tim Young Elevate Software www.elevatesoft.com |
Tue, Sep 24 2013 2:46 PM | Permanent Link |
Ronald | That's OK, I have some sort of workaround.
"Tim Young [Elevate Software]" schreef in bericht news:B2BA8A24-1FF8-43B3-B1ED-39D34615EC45@news.elevatesoft.com... Ronald, << The components are not really gone. Am I doing something wrong? >> No, it's a bug. The panel is setting the destroying flag for the component and that is interfering with it being removed from the components list. A fix will be in the next build. Tim Young Elevate Software www.elevatesoft.com |
This web page was last updated on Wednesday, October 9, 2024 at 05:37 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |