码迷,mamicode.com
首页 > Windows程序 > 详细

delphi TStringList.free 释放错误 invalid pointer operation

时间:2014-11-07 18:36:59      阅读:336      评论:0      收藏:0      [点我收藏+]

标签:style   io   color   ar   os   sp   on   bs   size   

var
   NeedStr : TStringList;
 begin
  NeedStr := TStringList.Create;

.....

try

   ......

tinally

  needstr.free;  /// 如果needstr值为nil时,直接释放会产生  invalid pointer operation 错误提示.

 //应该改为:       if NeedStr.Count>0 then NeedStr.Free;       

end;

 

delphi TStringList.free 释放错误 invalid pointer operation

标签:style   io   color   ar   os   sp   on   bs   size   

原文地址:http://www.cnblogs.com/smartlittleant/p/4081879.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!