Selaa lähdekoodia

Memory leak on RandomHash

Small memory leak fixed
PascalCoin 6 vuotta sitten
vanhempi
commit
9146c3071b
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      src/core/URandomHash.pas

+ 1 - 0
src/core/URandomHash.pas

@@ -1002,6 +1002,7 @@ end;
 function TRandomHashFast.TChecksummedByteCollection.Clone : TChecksummedByteCollection;
 begin
   Result := TChecksummedByteCollection.Create;
+  FreeAndNil( Result.FBytes ); // Memory Leak prevention prior to create new structure
   Result.FBytes := TList<TBytes>.Create(Self.FBytes);
   Result.FComputedIndex:= Self.FComputedIndex;
   Result.FChecksum:= Self.FChecksum;