diff --git a/src/ce_sharedres.pas b/src/ce_sharedres.pas index 5d8521ce..b522d490 100644 --- a/src/ce_sharedres.pas +++ b/src/ce_sharedres.pas @@ -9,27 +9,25 @@ procedure AssignPng(ctrl: TControl; const resName: string); implementation -procedure AssignPng(ctrl: TControl; const resName: string); var - png : TPortableNetworkGraphic; -begin - png := TPortableNetworkGraphic.Create; - try - try - png.LoadFromLazarusResource(resName); - if ctrl is TCustomBitBtn then - TCustomBitBtn(ctrl).Glyph.Assign(png) - else if ctrl is TCustomSpeedButton then - TCustomSpeedButton(ctrl).Glyph.Assign(png); - except - end; - finally - png.Free; - end; + png: TPortableNetworkGraphic; +procedure AssignPng(ctrl: TControl; const resName: string); +begin + try + png.LoadFromLazarusResource(resName); + if ctrl is TCustomBitBtn then + TCustomBitBtn(ctrl).Glyph.Assign(png) + else if ctrl is TCustomSpeedButton then + TCustomSpeedButton(ctrl).Glyph.Assign(png); + except + end; end; initialization + png := TPortableNetworkGraphic.Create; {$I ../src/ce_icons.inc} +finalization + png.Free; end.