?
Solved

FREE TCOMPONENTLIST

Posted on 2002-06-15
4
Medium Priority
?
357 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

649 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