Re: Unmanaged resources in a static class

Greg Young <[email protected]>
Newsgroups gmane.comp.windows.devel.dotnet.advanced
Message-ID <[email protected]>
Easy enough to test.

On Fri, Sep 19, 2008 at 4:54 AM, Simon Robinson <[email protected]> wrote:
> Thanks for the replies everyone.  Static reference to an instance does
> sound on the surface to be the easiest solution. I have one doubt though:
> It's occurred to me to wonder whether finalizers are guaranteed to be
> executed when the app exits? They are executed when a garbage collection
> happens but that's not the same thing. Does .NET do a garbage collection
> on app exit or does it just rely on Windows freeing up everything?  If it
> doesn't then keeping a static reference presumably won't make any
> difference.
>
> Ta
>
> Simon
>
> On Wed, 17 Sep 2008 19:33:14 -0700, Greg Young <[email protected]>
> wrote:
>
>>why not keep a static reference to an instance of the class instead of
>>using a static class?
>>
>>Cheers,
>>
>>Greg
>
> ===================================
> This list is hosted by DevelopMentor(R)  http://www.develop.com
>
> View archives and manage your subscription(s) at http://discuss.develop.com
>



--
It is the mark of an educated mind to be able to entertain a thought
without accepting it.

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.