Browse Source

Fix memory leak

Johann ELSASS 5 years ago
parent
commit
5b5702ce78
1 changed files with 7 additions and 0 deletions
  1. 7 0
      bccombobox.pas

+ 7 - 0
bccombobox.pas

@@ -95,6 +95,7 @@ type
     function GetListBox: TListBox;
   public
     constructor Create(AOwner: TComponent); override;
+    destructor Destroy; override;
     { Assign the properties from Source to this instance }
     procedure Assign(Source: TPersistent); override;
     procedure Clear;
@@ -661,6 +662,12 @@ begin
   FTimerCheckFormHide.OnTimer:= OnTimerCheckFormHide;
 end;
 
+destructor TBCComboBox.Destroy;
+begin
+  FreeAndNil(FItems);
+  inherited Destroy;
+end;
+
 procedure TBCComboBox.Assign(Source: TPersistent);
 var
   src: TBCComboBox;