Re: Unmanaged resources in a static class
Simon Robinson <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.advanced |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
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® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com