Fog Creek Software
Discussion Board

Memory Leak

I think my program is leaking memory, but I don't know what to do about it. I have an array type defined like this:

TStringArray = array[0..10, 0..15] of string;

And this function that gets called many times:

function GetStrings(ID: Integer): TStringArray;

Once I am done with the TStringArray, how do I release it? 

Thursday, January 02, 2003

You're okay. Strings are reference counted, and go away by themselves when there's no code running that can reach them, much like interface references.

Earl Dunovant
Thursday, January 02, 2003

Like Earl says: strings clean up after themselves. But if you want to check for memory leaks (which off course every coder does) use the great and free memproof:

Jan Derk
Friday, January 03, 2003

*  Recent Topics

*  Fog Creek Home