mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 04:39:36 +02:00
lcl: set FDataOwner to true in IntfImage after freeing data - fixes memory leak in the .ico reader
git-svn-id: trunk@15752 -
This commit is contained in:
parent
391ed314a8
commit
f181d04615
@ -513,7 +513,7 @@ end;
|
||||
|
||||
procedure TPicture.SaveToFile(const Filename: string; const FileExt: string = '');
|
||||
var
|
||||
Ext, F: string;
|
||||
Ext: string;
|
||||
Stream: TStream;
|
||||
begin
|
||||
if FileExt <> '' then
|
||||
|
@ -2927,6 +2927,14 @@ begin
|
||||
if FMaskLineStarts <> nil then Dispose(FMaskLineStarts);
|
||||
FMaskLineStarts := nil;
|
||||
FMaskSet := False;
|
||||
|
||||
if FDataOwner
|
||||
then ReallocMem(FRawImage.Palette, 0)
|
||||
else FRawImage.Palette := nil;
|
||||
FRawImage.PaletteSize := 0;
|
||||
|
||||
// old RawImage data has been cleared/destroyed => so new data must be owned by us
|
||||
FDataOwner := True;
|
||||
end;
|
||||
|
||||
procedure TLazIntfImage.CreateData;
|
||||
|
Loading…
Reference in New Issue
Block a user