Solved

FREE TCOMPONENTLIST

Posted on 2002-06-15
4
337 Views
Last Modified: 2010-08-05
FREE TCOMPONENTLIST

When I try to free TComponentList I get this error :

ACCESS VIOLATION,

and every time (after free method) when I try to use TComponentList named ComponentList.

How to solve this problem ?

Thanks.
0
Comment
Question by:ghjlk
  • 2
4 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 7080501
you should show how you free and access your list
0
 

Author Comment

by:ghjlk
ID: 7080565
//first oncreate event
componentlist.create;

//then two methods of create components
componentlist.add &
componentlist.insert

//in componentlist I put Forms, ActiveX components and others.


//section new
while componentlist.count>0 do
TControl(componentlist[0]).Free;

componentlist.free;
componentlist.create;

Thanks.
0
 

Author Comment

by:ghjlk
ID: 7080667
Sorry :
componentlist:=TComponentlist.create;
0
 
LVL 7

Accepted Solution

by:
Cynna earned 250 total points
ID: 7080733
ghjlk,

Try creating componentlist like this:
 
  componentlist:=TComponentlist.Create(FALSE);

This will ensure that componentlist.free doesn't try to free components that you already freed before.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question