 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
child Guest
|
Posted: Sun Jan 16, 2005 3:14 pm Post subject: When will indy10 become stabile ? |
|
|
Now, simple put a TIdTCPServer to a form,
assign the OnExecute event a line code:
"
beep;
"
then True Active property.
Run this app,
the OnExecute not fire.
when close app, app will error.
|
|
| Back to top |
|
 |
child Guest
|
Posted: Sun Jan 16, 2005 4:05 pm Post subject: Re: When will indy10 become stabile ? |
|
|
| Quote: |
the OnExecute not fire.
|
When client connect it will fire.
| Quote: | when close app, app will error.
|
trace the source, if not close server, then
app will error:
error point:
**********************************************
FreeAndNil(LYarn);
**********************************************
procedure TIdSchedulerOfThread.TerminateYarn(AYarn: TIdYarn);
var
LYarn: TIdYarnOfThread;
begin
LYarn := TIdYarnOfThread(AYarn);
if LYarn.Thread.Suspended then begin
// If suspended, was created but never started
// ie waiting on connection accept
LYarn.Thread.Resume;
**********************************************
FreeAndNil(LYarn);
**********************************************
end else begin
// Is already running and will free itself
LYarn.Thread.Stop;
// Dont free the yarn. The thread frees it (IdThread.pas)
end;
end;
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Sun Jan 16, 2005 8:41 pm Post subject: Re: When will indy10 become stabile ? |
|
|
"child" <jn_child (AT) tom (DOT) com> wrote
| Quote: | // If suspended, was created but never started
// ie waiting on connection accept
LYarn.Thread.Resume;
**********************************************
FreeAndNil(LYarn);
**********************************************
|
You must not be using the latest version, because that code does not appear
in the current version. It looks like this instead:
// If suspended, was created but never started
// ie waiting on connection accept
LYarn.Thread.Free;
FreeAndNil(LYarn);
Gambit
|
|
| Back to top |
|
 |
child Guest
|
Posted: Mon Jan 17, 2005 8:01 am Post subject: Re: When will indy10 become stabile ? |
|
|
| Quote: |
You must not be using the latest version, because that code does not
appear
in the current version. It looks like this instead:
// If suspended, was created but never started
// ie waiting on connection accept
LYarn.Thread.Free;
FreeAndNil(LYarn);
Gambit
****************************************** |
LYarn.Thread.Resume;
******************************************
This line added by me.
when remove this line, app will error also.
|
|
| Back to top |
|
 |
child Guest
|
Posted: Mon Jan 17, 2005 11:50 am Post subject: Re: When will indy10 become stabile ? |
|
|
Simple:
Put a TCPServer on form,
procedure TForm1.Button1Click(Sender: TObject);
begin
Self.IdTCPServer1.Active := True;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Self.IdTCPServer1.Active := False;
end;
Press Button1, then
Press Button2, will cause error.
|
|
| Back to top |
|
 |
child Guest
|
Posted: Mon Jan 17, 2005 12:16 pm Post subject: Re: When will indy10 become stabile ? |
|
|
Solution:
// Add
LYarn.Thread.Resume;
LYarn.Thread.Free;
// remove FreeAndNil(LYarn);
When LYarn.Thread.Free, it should will free the yarn.
procedure TIdSchedulerOfThread.TerminateYarn(AYarn: TIdYarn);
var
LYarn: TIdYarnOfThread;
begin
LYarn := TIdYarnOfThread(AYarn);
if LYarn.Thread.Suspended then begin
// If suspended, was created but never started
// ie waiting on connection accept
LYarn.Thread.Resume;
LYarn.Thread.Free;
// FreeAndNil(LYarn);
end else begin
// Is already running and will free itself
LYarn.Thread.Stop;
// Dont free the yarn. The thread frees it (IdThread.pas)
end;
end;
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|