Browse Source

* Merging revisions 42282 from trunk:
------------------------------------------------------------------------
r42282 | michael | 2019-06-25 07:54:25 +0200 (Tue, 25 Jun 2019) | 1 line

Fix memleak (bug ID 0035761)
------------------------------------------------------------------------

git-svn-id: branches/fixes_3_2@42284 -

michael 6 years ago
parent
commit
15303f3b55
1 changed files with 8 additions and 0 deletions
  1. 8 0
      packages/fcl-registry/src/registry.pp

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

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