Z
zobie
I have created a project that has two forms. Form1 has a button which
runs the following code:
private void button1_Click(object sender, System.EventArgs e)
{
Form2 f = new Form2();
f.Owner = this;
f.Show();
f.Close();
this.RemoveOwnedForm(f);
f.Dispose();
f = null;
}
Using .NET Memory Profiler (http://www.scitech.se/memprofiler) I am able
to see that Form2 is not disposed. This seems to be a huge issue. Has
anyone experienced this problem? Is there a workaround? Have I done
something incorrectly?
If I remove the line where the Owner is set, there is no problem with
Form2 being Disposed.
Thanks,
Nate
runs the following code:
private void button1_Click(object sender, System.EventArgs e)
{
Form2 f = new Form2();
f.Owner = this;
f.Show();
f.Close();
this.RemoveOwnedForm(f);
f.Dispose();
f = null;
}
Using .NET Memory Profiler (http://www.scitech.se/memprofiler) I am able
to see that Form2 is not disposed. This seems to be a huge issue. Has
anyone experienced this problem? Is there a workaround? Have I done
something incorrectly?
If I remove the line where the Owner is set, there is no problem with
Form2 being Disposed.
Thanks,
Nate