tidftp.abort freezes application D7 Indy 10

Giganews Newsgroups
Subject: tidftp.abort freezes application D7 Indy 10
Posted by:  Bartek Palczewski (bpalczews…@yahoo.ca)
Date: Thu, 18 May 2006

Hello !!
I have a very simple application:

procedure TForm1.Button1Click(Sender: TObject);
begin
  ftp.connect ;
  ftp.Get('ftp_test\domus.zip','c:\tests\domus.zip',true,false);
end;

procedure TForm1.FTPWork(ASender: TObject; AWorkMode: TWorkMode;
AWorkCount: Integer);
begin
  p.Position:=aworkcount ;
  application.ProcessMessages ;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  ftp.abort ;
end;

Aborting works well, that is, it stops downloading; howerver, it
"freezes" application - i cannot even close it. I found a way around by
causing exception:

ftp.abort ;
ftp.disconnect ;

which i simply ignore ... Is there a more elegant way to do it?

bartek

Replies