mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-03 21:20:25 +02:00
LCL: fix mem-leak in TRasterImage.LoadFromRawImage Issue #0035372 / Behaviour change: if source and dest are equal, then data is kept as it is.
Previously new mem of the same size was allocated, but no data written to it. Previous behaviour appears to be buggy since it did NOT load anything, so new behaviour is fine. (Only affects ADataOwner=False.) git-svn-id: trunk@61202 -
This commit is contained in:
parent
057100e30e
commit
76b9420caf
@ -586,6 +586,9 @@ begin
|
||||
if AImage.Description.Format = ricfNone then Exit; // empty image
|
||||
|
||||
img := GetRawImagePtr;
|
||||
if img = @AImage then //copy to self => no op
|
||||
exit;
|
||||
img^.FreeData;
|
||||
img^.Description := AImage.Description;
|
||||
if ADataOwner
|
||||
then begin
|
||||
|
Loading…
Reference in New Issue
Block a user