* Fixed memleakfix (r14889) so asignment works if TBitmap is separte class

git-svn-id: trunk@14894 -
This commit is contained in:
marc 2008-04-19 16:49:06 +00:00
parent dc7a8752ac
commit 481f2563c1

View File

@ -470,6 +470,7 @@ var
CurPageIndex: Integer;
j: Integer;
OldActivePage: String;
B: TBitmap;
begin
if fUpdatingNotebook then exit;
if IsUpdateLocked then begin
@ -552,7 +553,12 @@ begin
+'_'+CurComponent.ComponentClass.ClassName;
// Left and Top will be set in ReAlignButtons.
SetBounds(Left,Top,ComponentPaletteBtnWidth,ComponentPaletteBtnHeight);
Glyph := CurComponent.Icon;
// we cannot assing a custombitmap directly, so force a glyph
B := TBitmap.Create;
Glyph := B;
B.Free;
// we now have a glyp so we can assign
Glyph.Assign(CurComponent.Icon);
GroupIndex := 1;
Flat := true;
OnClick := @ComponentBtnClick;