O
Ofer B.
Hi
I had some memory problem with my application.
One of the reason was: not closing a data reader but it didn't solve all the
problems.
When I make more than one order, I can see the momory statuse decrease.
I use a global class that keeps some of the object that I use. Object like
the "Order" form.
To start an order I use this function:
if(Global.CurrentOrder == null)
{
Global.CurrentOrder = new Order(this.cboCustomers.Text);
Global.CurrentOrder.Show();
}
else
{
Global.CurrentOrder.Show();
}
To end an order I use:
Global.CurrentOrder.Close();
Global.CurrentOrder = null;
What do I do wrong? When do I use "Form.Close" and when Dispose?
Thanks Ofer
I had some memory problem with my application.
One of the reason was: not closing a data reader but it didn't solve all the
problems.
When I make more than one order, I can see the momory statuse decrease.
I use a global class that keeps some of the object that I use. Object like
the "Order" form.
To start an order I use this function:
if(Global.CurrentOrder == null)
{
Global.CurrentOrder = new Order(this.cboCustomers.Text);
Global.CurrentOrder.Show();
}
else
{
Global.CurrentOrder.Show();
}
To end an order I use:
Global.CurrentOrder.Close();
Global.CurrentOrder = null;
What do I do wrong? When do I use "Form.Close" and when Dispose?
Thanks Ofer