Board index » delphi » List.free seems not to work properly

List.free seems not to work properly

Very simple problem....

After creating a list and adding approx.
10000 of String-Items i tried to
free the occupied memory, using the
command list.free

But the taskmanager shows me that
memory isn't freed!

After running the function above for several times
Delphi gets me an OUT-OF-MEMORY-ERROR!

What's wrong?

Thanx
Charly

 

Re:List.free seems not to work properly


In article: <6f1an7$c7...@lilly.ping.de>  "Dirk Pukropski" <D.Pukrop...@ping.de> writes:

Quote

> Very simple problem....

> After creating a list and adding approx.
> 10000 of String-Items i tried to
> free the occupied memory, using the
> command list.free

> But the taskmanager shows me that
> memory isn't freed!

> After running the function above for several times
> Delphi gets me an OUT-OF-MEMORY-ERROR!

> What's wrong?

You need to give a direct sample of your code under such circumstances.

--

Greg Lorriman co. inc. & sons Ltd

Re:List.free seems not to work properly


Are you talking about TList?
TList does not free the objects themselves, it just frees the reference to
them.
If you are storing strings only, you should use TStringList anyway.
TStringList frees the stored strings.

bye-bye,
Peter Tiemann

Tips & Tricks for Delphi Programmers at http://www.preview.org/e/help.shtml

------------------------------------

Quote
Dirk Pukropski wrote in message <6f1an7$c7...@lilly.ping.de>...
>Very simple problem....

>After creating a list and adding approx.
>10000 of String-Items i tried to
>free the occupied memory, using the
>command list.free

>But the taskmanager shows me that
>memory isn't freed!

>After running the function above for several times
>Delphi gets me an OUT-OF-MEMORY-ERROR!

>What's wrong?

>Thanx
>Charly

Other Threads