Memory Leak in Pocket PC Version
Posted: Fri May 20, 2011 9:25 am
Hallo everybody, I have a problem with the memory in the pocket Pc Version.
Every second i update the chart, eventually with another chart typ (line, bar, ...):
After 5 min the memory on my Pocket PC is on an critical state.
Every second i update the chart, eventually with another chart typ (line, bar, ...):
Code: Select all
private Timer timer = new Timer();
public Form1()
{
InitializeComponent();
InitializeChart();
}
Steema.TeeChart.Styles.Line line1;
private void InitializeChart()
{
tChart1.Legend.Visible = false;
tChart1.Aspect.View3D = false;
line1 = new Steema.TeeChart.Styles.Line(tChart1.Chart);
line1.FillSampleValues();
tChart1.DoubleClick += new EventHandler(tChart1_DoubleClick);
timer.Interval = 1000;
timer.Enabled = true;
timer.Tick += new EventHandler(timer_Tick);
}
void timer_Tick(object sender, EventArgs e)
{
tChart1_DoubleClick(null, null);
}
void tChart1_DoubleClick(object sender, EventArgs e)
{
tChart1.Clear();
tChart1.Series.Clear();
tChart1.Series.Add(line1);
Random rnd = new Random();
tChart1.AutoRepaint = false;
line1.Clear();
line1.Add(rnd.Next(100));
for (int i = 1; i < 20; i++)
{
line1.Add(line1.YValues.Value[i - 1] + rnd.Next(10) - 5);
}
tChart1.AutoRepaint = true;
tChart1.Refresh();
}