<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div><span>Hi All,</span></div><div><br><span></span></div>On recent FPC 2.6.1 I notice a strange behavior with TStringList.Destroy<br>TStringList.Destroy, calls method TStringList.Clear, but the problem is that TStringList.Clear call methods Changing and Changed<br><br>This affect Zeos 6.6.6, I presume is because Zeos try to read Params from the SQL.Text, every time a Change occurs<br><br>I suggest a new InternalClear method, without calling Change/Changed that can be used in Destroy and Clear methods...<br><br>Some thing like this:<div><br><span></span></div><div><span>destructor TStringList.Destroy;<br>Var I : Longint;<br>begin<br> FOnChange:=Nil;<br> FOnChanging:=Nil;<br> InternalClear;<br> Inherited destroy;<br>end;<br><br>Procedure TStringList.Clear;<br>Var I : longint;<br>begin<br>
if FCount = 0 then Exit;<br> Changing;<br> InternalClear;<br> Changed;<br>end;<br><br>Procedure TStringList.InternalClear; (Private)<br>Var I : longint;<br>begin<br> if FCount = 0 then Exit;<br> <br> if FOwnsObjects then<br> begin<br> For I:=0 to FCount-1 do<br> begin<br> Flist^[I].FString:='';<br> freeandnil(Flist^[i].FObject);<br> end;<br> end<br> else<br> begin<br> For I:=0 to FCount-1 do<br> Flist^[I].FString:='';<br> end;<br> FCount:=0;<br> SetCapacity(0);<br>end;<br><br><br></span></div><div> </div><div>[]s
Daniel<br><br>Conheça o <a rel="nofollow" target="_blank" href="http://acbr.sourceforge.net">Projeto ACBr - Automaçao Comercial Brasil</a><br><a rel="nofollow" target="_blank" href="http://www.djsystem.com.br"><span style="font-weight:bold;">DJSystem</span> a Loja Patrocinadora do ACBr</a><br></div></div></body></html>