mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 19:05:54 +02:00
fpPDF: fix memory leak in TPDFImages.AddFromStream for KeepImage=True
git-svn-id: trunk@43471 -
This commit is contained in:
parent
3bc729fb8f
commit
2f244383be
@ -3213,10 +3213,12 @@ begin
|
|||||||
Reader.Free;
|
Reader.Free;
|
||||||
end;
|
end;
|
||||||
IP.Image:=I;
|
IP.Image:=I;
|
||||||
if Not KeepImage then
|
if KeepImage then
|
||||||
|
IP.OwnsImage := True
|
||||||
|
else
|
||||||
begin
|
begin
|
||||||
IP.CreateStreamedData(Owner.ImageStreamOptions);
|
IP.CreateStreamedData(Owner.ImageStreamOptions);
|
||||||
IP.FImage:=Nil; // not through property, that would clear the image
|
IP.DetachImage; // not through property, that would clear the image
|
||||||
i.Free;
|
i.Free;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user