* Patch so uninitialized sockets are not closed

git-svn-id: trunk@11673 -
This commit is contained in:
michael 2008-08-31 15:01:05 +00:00
parent 65f217ed02
commit 46f9928054

View File

@ -42,6 +42,7 @@ type
TSocketStream = class(THandleStream) TSocketStream = class(THandleStream)
Private Private
FSocketInitialized : Boolean;
FSocketOptions : TSocketOptions; FSocketOptions : TSocketOptions;
Procedure GetSockOptions; Procedure GetSockOptions;
Procedure SetSocketOptions(Value : TSocketOptions); Procedure SetSocketOptions(Value : TSocketOptions);
@ -215,11 +216,13 @@ Constructor TSocketStream.Create (AHandle : Longint);
begin begin
Inherited Create(AHandle); Inherited Create(AHandle);
FSocketInitialized := true;
GetSockOptions; GetSockOptions;
end; end;
destructor TSocketStream.Destroy; destructor TSocketStream.Destroy;
begin begin
if FSocketInitialized then
{$ifdef netware} {$ifdef netware}
CloseSocket(Handle); CloseSocket(Handle);
{$else} {$else}