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

Fix memleak (bug ID 0035761)

git-svn-id: trunk@42282 -
michael 6 жил өмнө
parent
commit
7137289d41

+ 8 - 0
packages/fcl-registry/src/registry.pp

@@ -243,6 +243,7 @@ type
   public
     constructor Create(const AFileName: string); overload;
     constructor Create(const AFileName: string; AAccess: LongWord); overload;
+    destructor destroy; override;
     function ReadDate(const Section, Name: string; Default: TDateTime): TDateTime; override;
     function ReadDateTime(const Section, Name: string; Default: TDateTime): TDateTime; override;
     function ReadInteger(const Section, Name: string; Default: Longint): Longint; override;
@@ -990,6 +991,13 @@ begin
   Create(AFileName,KEY_ALL_ACCESS);
 end;
 
+destructor TRegistryIniFile.destroy;
+
+begin
+  FreeAndNil(FRegInifile);
+  Inherited;
+end;
+
 procedure TRegistryIniFile.DeleteKey(const Section, Name: String);
 begin
   FRegIniFile.Deletekey(section,name);