fix bugs id=3104387,3104383 - mem leak in TRxLookupEdit and TRxTimeEdit

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1429 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2011-01-07 21:54:02 +00:00
parent 973e0ee879
commit 21900be3c0
2 changed files with 8 additions and 3 deletions

View File

@@ -598,6 +598,8 @@ begin
end; end;
constructor TRxCustomDBLookupEdit.Create(AOwner: TComponent); constructor TRxCustomDBLookupEdit.Create(AOwner: TComponent);
var
P:TBitmap;
begin begin
inherited Create(AOwner); inherited Create(AOwner);
FLocateObject:=CreateLocate(nil); FLocateObject:=CreateLocate(nil);
@@ -611,7 +613,9 @@ begin
// FDropDownCount:=8; // FDropDownCount:=8;
FFieldList:=TStringList.Create; FFieldList:=TStringList.Create;
Glyph:=CreateArrowBitmap; P:=CreateArrowBitmap;
Glyph.Assign(P);
P.Free;
ButtonWidth:=15; ButtonWidth:=15;
FPopUpFormOptions:=TPopUpFormOptions.Create; FPopUpFormOptions:=TPopUpFormOptions.Create;
end; end;
@@ -622,6 +626,7 @@ begin
FreeAndNil(FPopUpFormOptions); FreeAndNil(FPopUpFormOptions);
FFieldList.Clear; FFieldList.Clear;
FreeAndNil(FFieldList); FreeAndNil(FFieldList);
FreeAndNil(FLookupDataLink);
inherited Destroy; inherited Destroy;
end; end;

View File

@@ -261,8 +261,8 @@ const
constructor TRxSpinButton.Create(AOwner: TComponent); constructor TRxSpinButton.Create(AOwner: TComponent);
begin begin
inherited Create(AOwner); inherited Create(AOwner);
FUpBitmap := TBitmap.Create; { FUpBitmap := TBitmap.Create;
FDownBitmap := TBitmap.Create; FDownBitmap := TBitmap.Create;}
FUpBitmap := LoadBitmapFromLazarusResource(sSpinUpBtn); FUpBitmap := LoadBitmapFromLazarusResource(sSpinUpBtn);
FDownBitmap := LoadBitmapFromLazarusResource(sSpinDownBtn); FDownBitmap := LoadBitmapFromLazarusResource(sSpinDownBtn);
FUpBitmap.OnChange := @GlyphChanged; FUpBitmap.OnChange := @GlyphChanged;