<p>Am 13.03.2013 10:53 schrieb "Xiangrong Fang" <<a href="mailto:xrfang@gmail.com">xrfang@gmail.com</a>>:<br>
><br>
> 2013/3/13 Sven Barth <<a href="mailto:pascaldragon@googlemail.com">pascaldragon@googlemail.com</a>><br>
>><br>
>> Am 13.03.2013 10:08 schrieb "Xiangrong Fang" <<a href="mailto:xrfang@gmail.com">xrfang@gmail.com</a>>:<br>
>> > 2) After SetLength(myarray, 0), is myarray nil or pointing to some invalid address?<br>
>><br>
>> It will be Nil. An equivalent alternative would be:<br>
>><br>
>> MyArray := Nil;<br>
><br>
><br>
> Sorry, I didn't see this reply just now... You mean, by MyArray := nil; but NOT calling SetLength(MyArray, 0); there will NOT be memory leaks?</p>
<p>As dynamic arrays are reference counted they are equal.</p>
<p>Regards,<br>
Sven</p>