现在的位置: 首页 > 综合 > 正文

TobjectList Clear

2013年07月29日 ⁄ 综合 ⁄ 共 315字 ⁄ 字号 评论关闭

TobjectList Clear方法继承自TList.Clear ,

Call Clear to empty the
Items array and set the Count to 0. Clear also frees the memory used to store the
Items array and sets the Capacity to 0. 

这句说明,clear方法释放了TobjectList 所分配的空间,但是如果用原对象的引用来对属性进行读取的时候,字符串属性被清空了,但是数字型属性还未被清空。

Free的效果和Clear差不多,但是必须对TobjectList进行置Nil,否则在Assign(对象)的时候会认为对象还存在。

Delphi 释放这块,还是比较晕乎啊,呵呵

抱歉!评论已关闭.