On 25 Feb 2011, at 14:02, Wimpie Nortje wrote:

Initially I only disposed the record. This lead to lots of memory leaks.
Then I set dynarray:= nil before disposing the record. Less mem leaks,
but still a lot.
Then I started to finalize the dynamic array before disposing the
record. A huge improvement but still some leaks.

I get the feeling the arrays are sometimes not free'd but I don't
understand why.

Calling dispose() on a record with a dynamic array field will free the array (and recursively finalize all its elements) as long as the pointer on which you call it is correctly typed in the source code. The fact that you still get memory leaks after everything you are doing suggests that something else is wrong in your program.


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to