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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Has anyone noticed a Mem. leak using treeView control in C#?

Thread ID:

Created:

Updated:

Platform:

Replies:

3333 Mar 13,2003 03:21 PM UTC Apr 8,2003 12:06 PM UTC WinForms 2
loading
Tags: FAQ
PeteB
Asked On March 13, 2003 03:21 PM UTC

I have created a C# MDI app that launches multiple instances of child forms containing a treeView control. I populate the tree completely when the form loads and Memory increases about 10MB per instance of the form. On closing the child windows, the memory does not get recovered, even after calling GC.Collect(). After an hour my app is > 200MB. Any ideas? Help!!

PeteB
Replied On March 13, 2003 04:38 PM UTC

UPDATE: I think I have resolved this...it seems to be a TreeView bug. You have to clear all nodes from the treeview before closing the form or they do not get cleared even once the form is gone...I assume this should be handled by the control therefore a bug. Code is: treeView1.Nodes.Clear() I do call GC.Collect() after as an added precaution.

PeteB
Replied On April 8, 2003 12:06 PM UTC

FYI: This does appear to have been the issue. Clear all nodes before exiting Form with Treeview.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;