2
0
Эх сурвалжийг харах

fixed some more memory leaks.

Ugochukwu Mmaduekwe 7 жил өмнө
parent
commit
888b2b3a1b

+ 10 - 1
CryptoLib/src/Math/EC/Multiplier/ClpGlvMultiplier.pas

@@ -22,6 +22,7 @@ unit ClpGlvMultiplier;
 interface
 
 uses
+  ClpSetWeakRef,
   ClpAbstractECMultiplier,
   ClpIECInterface,
   ClpIGlvEndomorphism,
@@ -47,6 +48,8 @@ type
   public
     constructor Create(const curve: IECCurve;
       const glvEndomorphism: IGlvEndomorphism);
+    destructor Destroy; override;
+
   end;
 
 implementation
@@ -62,10 +65,16 @@ begin
     raise EArgumentCryptoLibException.CreateRes(@SCurveUnknownGroupOrder);
   end;
 
-  Fcurve := curve;
+  // Fcurve := curve;
+  TSetWeakRef.SetWeakReference(@Fcurve, curve);
   FglvEndomorphism := glvEndomorphism;
 end;
 
+destructor TGlvMultiplier.Destroy;
+begin
+  inherited Destroy;
+end;
+
 function TGlvMultiplier.MultiplyPositive(const p: IECPoint;
   const k: TBigInteger): IECPoint;
 var