lcl: free shareimage image when FreeImage is called in TCustomBitmap. This allows to change PixelFormat to desired.

git-svn-id: trunk@31469 -
This commit is contained in:
paul 2011-06-30 07:08:29 +00:00
parent 0ac2f35d4e
commit 59684c6edd
2 changed files with 8 additions and 2 deletions

View File

@ -1299,7 +1299,7 @@ type
procedure Clear; override;
procedure BeginUpdate(ACanvasOnly: Boolean = False);
procedure EndUpdate(AStreamIsValid: Boolean = False);
procedure FreeImage;
procedure FreeImage; virtual;
function BitmapHandleAllocated: boolean; virtual; abstract;
function MaskHandleAllocated: boolean; virtual; abstract;
function PaletteAllocated: boolean; virtual; abstract;
@ -1398,8 +1398,8 @@ type
public
constructor Create; override;
destructor Destroy; override;
procedure Clear; override;
procedure FreeImage; override;
function GetResourceType: TResourceType; override;
function LazarusResourceTypeValid(const ResourceType: string): Boolean; override;
function BitmapHandleAllocated: boolean; override;

View File

@ -45,6 +45,12 @@ begin
inherited Clear;
end;
procedure TCustomBitmap.FreeImage;
begin
inherited FreeImage;
TSharedCustomBitmap(FSharedImage).FreeImage;
end;
constructor TCustomBitmap.Create;
begin
inherited Create;