so lets say we have some thing like this websericeclient object
var myname = new WebServiceClient().GetName ( ) ;
what will happen to this object (WebServiceClient()) is it going to dispose automatically or stay in memory .
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It depends on the
_GetName()_method. And on the_WebServiceClient()_.Let’s take the example:
If your object implements
Dispose(), always try to call it yourself. Don’t only rely on the garbage collector.