View Issue Details

IDProjectCategoryView StatusLast Update
0036331PackagesPackagespublic2020-03-23 16:28
ReporterMarcou Gilles Assigned Towp  
Status resolvedResolutionfixed 
Product Version2.0 
Summary0036331: Memory leak in fpvectorial

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


if i>1 then
Steps To ReproduceWrite an application and use the function DrawFPVectorialToCanvas
TagsNo tags attached.
Fixed in Revision62301
Attached Files



2019-11-21 11:17

developer   ~0119414

Please prepare a demo showing the issue as well as a proper patch. Nobody is maintaining fpvectorial at the moment, and you would help us this way.


2019-11-27 00:10

developer   ~0119520

Fixed. Please test and close if ok, otherwise reopen.

Issue History

Date Modified Username Field Change
2019-11-20 19:09 Marcou Gilles New Issue
2019-11-21 11:17 wp Note Added: 0119414
2019-11-21 11:17 wp Assigned To => wp
2019-11-21 11:17 wp Status new => assigned
2019-11-21 11:17 wp Status assigned => feedback
2019-11-21 11:17 wp LazTarget => -
2019-11-27 00:10 wp Status feedback => resolved
2019-11-27 00:10 wp Resolution open => fixed
2019-11-27 00:10 wp Fixed in Revision => 62301
2019-11-27 00:10 wp LazTarget - => 2.0.8
2019-11-27 00:10 wp Note Added: 0119520