Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

If we not suppress finalize method in dispose what will happen?

Answer Posted / seema dalal

Dispose methods can be called automatically, if client
forget to call it.
for this ,Call the Dispose method in Finalize method and in
Dispose method suppress the finalize
method using GC.SuppressFinalize. Below is the sample code
of the pattern. This is the
best way we do clean our unallocated resources and yes not
to forget we do not get the hit
of running the Garbage collector twice.

Public Class ClsTesting
Implements IDisposable
Public Overloads Sub Dispose()Implements IDisposable.Dispose
' write ytour clean up code here
GC.SuppressFinalize(Me)
End Sub

Protected Overrides Sub Finalize()
Dispose()
End Sub
End Class

Is This Answer Correct ?    0 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why to use Html.Partial in ASP.Net MVC?

1130


Explain test driven development (tdd) ?

1018


what is use of entity container?

1059


explain why t4 entity is important in entity framework?

1045


Explain the new features 3.5 framework against with the tool?

953


What is .net framework & its benefits?

1066


How we can call a javascript function on the change of a dropdown list in mvc?

1057


What are actions in mvc?

1009


Does windows 10 need .net framework?

1013


What are the levels at which filters can be applied in an asp.net mvc application?

1133


What is Differnce between html.action and ajax.action?

1019


Why to use '{resource}.axd/{*pathInfo}' in routing in ASP.Net MVC?

2726


What are the versions of .net framework?

995


Which version of .net framework is installed?

969


Which is the root namespace for fundamental types in .net framework?

1010