![]() | Steema Issues DatabaseNote: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;otherwise you can use StackOverflow. Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy. |
| Summary: | Memory leak at RemoveSeries | ||
|---|---|---|---|
| Product: | VCL TeeChart | Reporter: | yeray alonso <yeray> |
| Component: | Series | Assignee: | Steema Issue Manager <issuemanager> |
| Status: | RESOLVED NOTABUG | ||
| Severity: | enhancement | CC: | david |
| Priority: | --- | ||
| Version: | 140923 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows | ||
| URL: | http://www.teechart.net/support/viewtopic.php?f=1&t=15206 | ||
| Chart Series: | --- | Delphi / C++ Builder RAD IDE Version: | |
RemoveSeries simply removes the series from the chart. It is equivalent to: Chart1[0].ParentChart := nil; or: Series1.ParentChart := nil; To destroy the series, do: Series1.Free; or: Chart1[0].Free; or, for all series in a chart: Chart1.FreeAllSeries; |
RemoveSeries does not release the memory allocated to the removed series. If you open up TaskManager you'll see the memory allocated increases and never decreases: uses Chart, Series; var Chart1: TChart; procedure TForm1.FormCreate(Sender: TObject); begin Chart1:=TChart.Create(Self); Chart1.Parent:=Self; Chart1.Align:=alClient; with TTimer.Create(Self) do begin Interval:=100; OnTimer:=Timer1Timer; Enabled:=true; end; end; procedure TForm1.Timer1Timer(Sender: TObject); begin while Chart1.SeriesCount > 0 do Chart1.RemoveSeries(0); Chart1.AddSeries(TBarSeries).FillSampleValues(); end;