FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour loosing memory with TInternet
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
loosing memory with TInternet
Posted: Sun Mar 15, 2015 08:02 PM
Can someone please help me.
I am loosing memory with TInternet class.

Please see the following program of the FW samples.
I modified the code that the function is called in a loop.

Please see the attached screen shot. Everytime you call the function classdata adds a new TFtp.

Thanks in advance
Otto





Code (fw): Select all Collapse
function Main()
local I:= 0


for I:= 1 to 50
testftp()
msgWait("ok"+ str(I))
next

msginfo("Ende")


return nil

function testftp
   local oInternet := TInternet():New()
   local oFTP      := TFTP():New( "ftp.microsoft.com", oInternet ) // Microsoft FTP
   local aFiles

xbrowse( oInternet:aFTPs)

   if ! Empty( oFTP:hFTP )
      aFiles = oFTP:Directory( "*.*" )
    //  AEval( aFiles, { | aFile | MsgInfo( aFile[ 1 ], aFile[ 3 ] ) } )
   else
      MsgAlert( "oFTP:hFTP is null" )
   endif

   oInternet:End()

   //MsgInfo( "Done!" )

return nil

//----------------------------------------------------------------------------//
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: loosing memory with TInternet
Posted: Mon Mar 16, 2015 02:41 AM
Hello Otto


try to delete manually the aFTPs array

Code (fw): Select all Collapse
....
oInternet:End()

hb_ADel( oInternet:aFTPs, 1, .T. ) 
....

Continue the discussion