We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

FillStyle.Color memory leak

I am testing with SimpleFlow_2008 project (WinForm.Diagram Sample)

I just changed color of node using timer. but vm is increased continually. I tested for 8 hour.
I want to check why this problem is happened.

follow content is part of sample code. and attached all of sample code.

Please check my problem. Thank you.

private void timer1_Tick(object sender, EventArgs e)
{
Ellipse ellipse1 = m_Ellipse1 as Ellipse;
Ellipse ellipse2 = m_Ellipse2 as Ellipse;
Syncfusion.Windows.Forms.Diagram.Rectangle rectangle = m_Rectangle as Syncfusion.Windows.Forms.Diagram.Rectangle;
Polygon polygon = m_Polygon as Polygon;

if (m_fCurrent1 == false)
{
ellipse1.FillStyle.Color = Color.Blue;
m_fCurrent1 = true;
}
else
{
ellipse1.FillStyle.Color = Color.Red;
m_fCurrent1 = false;
}

if (m_fCurrent2 == false)
{
ellipse2.FillStyle.Color = Color.Blue;
m_fCurrent2 = true;
}
else
{
ellipse2.FillStyle.Color = Color.Red;
m_fCurrent2 = false;
}

if (m_fCurrent3 == false)
{
rectangle.FillStyle.Color = Color.Blue;
m_fCurrent3 = true;
}
else
{
rectangle.FillStyle.Color = Color.Red;
m_fCurrent3 = false;
}

if (m_fCurrent4 == false)
{
polygon.FillStyle.Color = Color.Blue;
m_fCurrent4 = true;
}
else
{
polygon.FillStyle.Color = Color.Red;
m_fCurrent4 = false;
}
}



CS_5b49bdcb.zip

1 Reply

Dinesh M March 9, 2010 07:29 AM UTC

Hi Kim,

This increase in VM should be due to the fact that the HistoryManger of diagram records all the action done there by increasing the memory. Please try using the following code and let me know if it helps you.

private void timer1_Tick(object sender, EventArgs e)
{
diagram1.Model.HistoryManager.Stop();
//You code that does some action.
diagram1.Model.HistoryManager.Start();
}

Regards,
Dinesh
Loader.
Live Chat Icon For mobile
Up arrow icon