|
Hi,
For anyone else who's having memory problems using cool list controls based on the TaskListControl, i've discovered 2 possibly dodgy areas in the TaskListControl.cs class..
1) surely the graphics object created here should be disposed?
// draw list Graphics g = Graphics.FromImage(m_bmp); DrawItems(g);
2) Gee, this if statement is really going to make things more efficient! Not!
// only create if don't have one of size changed if (m_bmp == null || m_bmp.Width != this.Width || m_bmp.Height != this.Height) { // memory bitmap to draw on m_bmp = new Bitmap(this.Width-Const.ScrollBarWidth, this.Height);
..... }
I've changed the if statement to check the correct width before re-creating, plus i call dispose on the bitmap before re-creating it (if it's not null).
I hope this helps your memory use, as it has mine! |