Stories recently tagged with 'dispose'

The Disposable Pattern(nuclex.org)

submitted by CygonCygon(134) 2 years, 5 months ago

Simple explanation of the Disposable Pattern in .NET for developers new to garbage collection. Explains when to implement the IDisposable interface only, where a finalizer is required and why you mustn't call into other objects from the finalizer thread. Also shows common use cases illustrating when to implement IDisposable and when to implement the full Disposable Pattern. read more...

add a comment |category: |Views: 17

tags: another

What If I Don’t Call Dispose() on my LINQ to SQL DataContext Object?(weblogs.asp.net)

submitted by crpietschmanncrpietschmann(11.3k) 3 years, 9 months ago

Steven Walther recently posted on the subject of disposing of DataContext objects and provided some interesting insight into what actually happens. From what he says it sounds like the DataContext object acts much like the SqlDataAdapter class. It opens the connection right before a query is executed and closes it immediately after. I don’t want to steal Steven’s thunder so check out his post on the subject (the last part of the article talks about the consequences…or lack of consequences…of not calling Dispose()). read more...

add a comment |category: |Views: 37

tags: another

CA1816 - Dispose Pattern(dotnethitman.spaces.live.com)

submitted by misbaharefinmisbaharefin(845) 4 years ago

Warning CA1816 : Microsoft.Usage : Change 'xxx.Dispose()' to call 'GC.SuppressFinalize(object)'. This will prevent unnecessary finalization of the object once it has been disposed and it has fallen out of scope. read more...

add a comment |category: |Views: 41

tags: another

Things you MUST dispose(dotnetfacts.blogspot.com)

submitted by eugenciutaeugenciuta(715) 4 years, 1 month ago

When the .NET Framework instantiates an object, it allocates memory for that object on the managed heap. The object remains on the heap until it's no longer referenced by any active code, at which point the memory it's using is reclamed by the Garbage Collector (GC). Before the GC deallocates the memory, the framework calls the object's Finalize() method, but developers are responsible for calling the Dispose() method. read more...

add a comment |category: |Views: 22

tags: another