Weird Form Dispose Error

G

Guest

I have a form that contains a wrapper class for a TcpConnection that is to be
used as an MDI Child form. Sometimes, when this form is closed from the main
form, it will throw a System.NullReferenceException in the default Dispose
override method (provided by the form designer).

protected override void Dispose( bool disposing )
{
if(disposing)
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}

It is throwing on the base.Dispose( disposing ); line and saying "Additional
information: Object reference not set to an instance of an object." I'm not
really sure as to what the cause is of this but it is the only mdi child (out
of about 20) that throws and exception, so I assume it may be related to the
connection class. FYI, I have a public property to the connection class in
the form.

Anyone know the solution?

Thanks,
Jonathan
 
M

Mangesh Kodilkar

I am facing a similar problem and my child form uses a web browser control.
Do you have any clue?
Please help..

With Regards,
Mangesh Kodilkar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top