Permalink
Browse files

ensure interface is assigned to variable (for FPC)

  • Loading branch information...
pavel.mash
pavel.mash committed Oct 29, 2018
1 parent 8efc142 commit 6b47c9e8dad412dffca46eab9f4f47458c0c30b7
Showing with 7 additions and 3 deletions.
  1. +2 −1 SynBidirSock.pas
  2. +5 −2 SynDBODBC.pas
@@ -3449,8 +3449,9 @@ constructor TAsynchConnections.Create(OnStart, OnStop: TNotifyThreadEvent;
aStreamClass: TAsynchConnectionClass; const ProcessName: SockString;
aLog: TSynLogClass; aOptions: TAsynchConnectionsOptions; aThreadPoolCount: integer);
var i: integer;
log: ISynLog;
begin
aLog.Enter('Create(%,%,%)',[aStreamClass,ProcessName,aThreadPoolCount],self);
log := aLog.Enter('Create(%,%,%)',[aStreamClass,ProcessName,aThreadPoolCount],self);
if (aStreamClass=TAsynchConnection) or (aStreamClass=nil) then
raise EAsynchConnections.CreateUTF8('%.Create(%)',[self,aStreamClass]);
if aThreadPoolCount<=0 then
@@ -1239,17 +1239,20 @@ destructor TODBCConnection.Destroy;
end;
procedure TODBCConnection.Disconnect;
var log: ISynLog;
begin
try
inherited Disconnect; // flush any cached statement
finally
if (ODBC<>nil) and (fDbc<>nil) then
if (ODBC<>nil) and (fDbc<>nil) then begin
with ODBC do begin
SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'Disconnect'{$endif});
log := SynDBLog.Enter(self{$ifndef DELPHI5OROLDER},'Disconnect'{$endif});
Disconnect(fDbc);
FreeHandle(SQL_HANDLE_DBC,fDbc);
fDbc := nil;
end;
end else

This comment has been minimized.

@synopse

synopse Oct 29, 2018

Owner

not needed :)

This comment has been minimized.

@pavelmash

pavelmash Oct 30, 2018

Collaborator

not needed nil assignment is removed

log := nil;
end;
end;

0 comments on commit 6b47c9e

Please sign in to comment.