From 21900be3c01911e40694163c2b665ab4ded71045 Mon Sep 17 00:00:00 2001 From: alexs75 Date: Fri, 7 Jan 2011 21:54:02 +0000 Subject: [PATCH] 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 --- components/rx/rxlookup.pas | 7 ++++++- components/rx/rxspin.pas | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/components/rx/rxlookup.pas b/components/rx/rxlookup.pas index cbc4f40c4..99b5c7f25 100644 --- a/components/rx/rxlookup.pas +++ b/components/rx/rxlookup.pas @@ -598,6 +598,8 @@ begin end; constructor TRxCustomDBLookupEdit.Create(AOwner: TComponent); +var + P:TBitmap; begin inherited Create(AOwner); FLocateObject:=CreateLocate(nil); @@ -611,7 +613,9 @@ begin // FDropDownCount:=8; FFieldList:=TStringList.Create; - Glyph:=CreateArrowBitmap; + P:=CreateArrowBitmap; + Glyph.Assign(P); + P.Free; ButtonWidth:=15; FPopUpFormOptions:=TPopUpFormOptions.Create; end; @@ -622,6 +626,7 @@ begin FreeAndNil(FPopUpFormOptions); FFieldList.Clear; FreeAndNil(FFieldList); + FreeAndNil(FLookupDataLink); inherited Destroy; end; diff --git a/components/rx/rxspin.pas b/components/rx/rxspin.pas index a4288adbe..234cba8a3 100644 --- a/components/rx/rxspin.pas +++ b/components/rx/rxspin.pas @@ -261,8 +261,8 @@ const constructor TRxSpinButton.Create(AOwner: TComponent); begin inherited Create(AOwner); - FUpBitmap := TBitmap.Create; - FDownBitmap := TBitmap.Create; +{ FUpBitmap := TBitmap.Create; + FDownBitmap := TBitmap.Create;} FUpBitmap := LoadBitmapFromLazarusResource(sSpinUpBtn); FDownBitmap := LoadBitmapFromLazarusResource(sSpinDownBtn); FUpBitmap.OnChange := @GlyphChanged;