Board index » delphi » Anonymous objects as parameters

Anonymous objects as parameters

Hi,

I am afraid this could be a stupid question, but...

I use a function "filter(s : TChartSeries, f : TFilter) : TChartSeries" to
applicate a specific filter to ChartSeries s. Sometimes I do this by
calling it like

mySeries := filter(mySeries, TPolynomFit.Create(d));

is the anonymous TPolynomFit-instance freed after the function is finished
does it remain in memory? I sometimes(!) get AccessViolations that I cannot
explain to myself. So I finally though this could possibly cause the errors.

Thank in advance!

Karsten

 

Re:Anonymous objects as parameters


On Fri, 14 Jun 2002 11:33:18 +0200, "Karsten Sch{*word*55}"

Quote
<kschw...@web.de> wrote:
> mySeries := filter(mySeries, TPolynomFit.Create(d));

> is the anonymous TPolynomFit-instance freed after the function is finished

No.

Quote
> does it remain in memory?

Yes.

Quote
> I sometimes(!) get AccessViolations that I cannot
> explain to myself. So I finally though this could possibly cause the errors.

No. Only referencing freed objects can cause an AV, not memory leaks
that are not freed at all.

Other Threads