[fpc-pascal] How to free this memory and avoid memory leak

Andrew Brunner andrew.t.brunner at gmail.com
Thu Oct 8 16:21:42 CEST 2009


>
>      Move(p, tocarray[0], SizeOf(tocarray));
> This causes an Access Violation at runtime.
>

This should not cause as RAV.  You must call
SetLength(toarray,SizeOfMemory) and also don't use SizeOf(tocarray)
use Length(tocarray)*SizeOf(What ever the element is))



More information about the fpc-pascal mailing list