Re: IndySoap Leaking Objects

Giganews Newsgroups
Subject: Re: IndySoap Leaking Objects
Posted by:  Grahame Grieve (graha…@kestral.com.au)
Date: Wed, 16 Jul 2003

Eric erhardt wrote:

> I am getting a Leaking Object report for TIdSoapDateTime. Can anyone
> help?
>
> Code snipit...
>
> procedure TForm1.LoadPageCounts;
> var
>  soapDate: TIdSoapDateTime;
> begin
> try
> SNMP:=TSNMPSend.Create;
> pcIntF:= GetIpagecounts(idSoapClientWInInet1);
> soapDate:= TIdSoapDateTime.Create;

allocate an object
>
> [.. Do a bunch of SNMP crap ...]
>
> if SysType <> 5 Then
> begin
> soapDate:= DateTimeToIdSoapDateTime(now);

allocate a new object

> pcIntf.InsertPageCount(0,txtCustNo.text,s1,s2,soapDate,StrToIntDef(s4,
> 0),Str ToIntDef(s5,0),s3,0);
> Memo1.Lines.Add('Adding Record to server for '+s1);
> end
> finally
> SNMP.Free;
> soapDate.Free;

free up the second object. the first leaks.
Now you know how useful leak tracking is.

You should use soapDate.AsDateTime := now
instead

Grahame

Replies

None

In response to

IndySoap Leaking Objects posted by Eric erhardt on Tue, 15 Jul 2003