Browse Source

Merge pull request #206 from UrbanCohortDev/master

Delphi 10.4 restricted FreeAndNil to objects so cannot be used on Rec…
Pascal Coin 4 years ago
parent
commit
0e77970990
2 changed files with 12 additions and 1 deletions
  1. 7 1
      src/config.inc
  2. 5 0
      src/core/UNetProtocol.pas

+ 7 - 1
src/config.inc

@@ -35,7 +35,9 @@
 
   // Activate to define CryptoLib4Pascal by default on all compilations
   {.$DEFINE Use_CryptoLib4Pascal}
-
+  // Add the following paths to the project Search Path is this option is used
+  // .\libraries\cryptolib4pascal
+  // .\libraries\simplebaselib4pascal  
 
   // Used to activate RandomHash in V4 hard-fork
   {$DEFINE ACTIVATE_RANDOMHASH_V4}
@@ -111,6 +113,10 @@ ERROR: You must select ONLY ONE option: Use_OpenSSL or Use_CryptoLib4Pascal
   {$ELSE}
     {$UNDEF NO_ANSISTRING}
   {$ENDIF}
+  
+  {$IF COMPILERVERSION > 33}
+    {$DEFINE DELPHI_SYDNEY_PLUS}  
+  {$ENDIF}
 {$ENDIF}
 
 

+ 5 - 0
src/core/UNetProtocol.pas

@@ -1243,7 +1243,12 @@ Var l : TList<TNetConnection>;
   tdc : TThreadDiscoverConnection;
 begin
   TLog.NewLog(ltInfo,ClassName,'TNetData.Destroy START');
+  {$IFDEF DELPHI_SYDNEY_PLUS }
+  SetLength(FOnConnectivityChanged.Handlers, 0);
+  SetLength(FOnConnectivityChanged.MainThreadHandlers, 0);
+  {$ELSE}
   FreeAndNil(FOnConnectivityChanged);
+  {$ENDIF}
   FOnGetNewBlockchainFromClientDownloadNewSafebox := Nil;
   FOnStatisticsChanged := Nil;
   FOnNetConnectionsUpdated := Nil;