I am pulling my hair out trying to figure out why a closed form is still appearing in the memory list.
When I select it, under the 'Merged paths to objects...', the item in the tree says "Objects are roots themselves"
When I select the form and choose "Paths from GC Roots...", I see in the tree :
- NAME OF FORM [Stack Local]
control of System.Windows.Forms.Control/ControlNativeWindow {GC Handle]
Can you help me out with this?
Thanks!
Help with a form not released
-
- Posts: 1624
- Joined: Tue Aug 10, 2004 7:52 pm
Re: Help with a form not released
It seems that reference to form object is stored in some local variable of method which never finishes.
-
- Posts: 72
- Joined: Thu Feb 21, 2008 11:08 am
Re: Help with a form not released
We had a simalar problem, cant remember exact what it was, think its a static event that is holding the reference. Or you have implemented a static field of some sort in the form as Vladimir says, Use...ajh wrote:
When I select the form and choose "Paths from GC Roots...", I see in the tree :
- NAME OF FORM [Stack Local]
control of System.Windows.Forms.Control/ControlNativeWindow {GC Handle]
Can you help me out with this?
Thanks!
Code: Select all
using(MyForm form = new MyForm())
{
...
...
}
Funny thing, is that we had to use another profiler (demo version) to detect the details what event it was...