luistsousa
Technical User
Hello
Always that I run the following code gives an error to me, of memory when arrives at last serie to delete. Somebody knows which is the problem?
TLineSeries *serie[10];
for(int reg=0;reg<5;reg++){
TLineSeries *ls;
ls = new TLineSeries(DBChart1);
serie[reg]=ls;
DBChart1->View3D = true;
DBChart1->AddSeries(ls);
DBChart1->SeriesList->Series[0]=ls;
DBChart1->SeriesList->Series[0]->DataSource=Table1;
DBChart1->SeriesList->Series[0]->YValues->ValueSource=name;
DBChart1->SeriesList->Series[0]->XLabelsSource="date_id";
DBChart1->SeriesList->Series[0]->XValues->ValueSource="date_id";
DBChart1->SeriesList->Series[0]->XValues->DateTime=true;
Table1->Next();
}
for(int reg=0;reg<5;reg++)
delete serie[reg];
REgards
Always that I run the following code gives an error to me, of memory when arrives at last serie to delete. Somebody knows which is the problem?
TLineSeries *serie[10];
for(int reg=0;reg<5;reg++){
TLineSeries *ls;
ls = new TLineSeries(DBChart1);
serie[reg]=ls;
DBChart1->View3D = true;
DBChart1->AddSeries(ls);
DBChart1->SeriesList->Series[0]=ls;
DBChart1->SeriesList->Series[0]->DataSource=Table1;
DBChart1->SeriesList->Series[0]->YValues->ValueSource=name;
DBChart1->SeriesList->Series[0]->XLabelsSource="date_id";
DBChart1->SeriesList->Series[0]->XValues->ValueSource="date_id";
DBChart1->SeriesList->Series[0]->XValues->DateTime=true;
Table1->Next();
}
for(int reg=0;reg<5;reg++)
delete serie[reg];
REgards