Memory leak in fpvectorial
Original Reporter info from Mantis: marcou
-
Reporter name: Marcou Gilles
Original Reporter info from Mantis: marcou
- Reporter name: Marcou Gilles
Description:
File:
fpvectorial.pas
In the procedure:
procedure TvVectorialPage.Render(ADest: TFPCustomCanvas;
ADestX: Integer; ADestY: Integer; AMulX: Double; AMulY: Double;
ADoDraw: Boolean = true);
The variable rInfo is setup as an out parameter of a call to the function InitializeRenderInfo:
InitializeRenderInfo(rInfo, ADest, nil);
rInfo is of type TvRenderInfo, which fields are classes.
Later, at first iteration of a loop, the rInfo takes the value of another variable and therefore loses the binding to the classes to its initial classes intances.
if i = 0 then
rInfo := RenderInfo
This is the origin of a memory leak.
A solution would be to remove the line:
InitializeRenderInfo(rInfo, ADest, nil);
and instead:
1/ rInfo:=RenderInfo
2/ Replace the condition
if i = 0 then
rInfo := RenderInfo
else
by
if i>1 then
Steps to reproduce:
Write an application and use the function DrawFPVectorialToCanvas
Mantis conversion info:
- Mantis ID: 36331
- Version: 2.0
- Fixed in revision: 62301 (#c911f232)
- Target version: 2.0.8