Re: [ADVANCED-DOTNET] String.Compare seems to fail when it should not

2008-09-19 Thread Ryan Heath
At last, the problem is fixed. One of the strings was found to be user input (that's a long story ...) And users can insert any char they want to ... We were put on the wrong track, since our db converts the error log into ascii chars; what we read in the log was not equal to what had happened at

Re: [ADVANCED-DOTNET] Unmanaged resources in a static class

2008-09-19 Thread Simon Robinson
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

Re: [ADVANCED-DOTNET] Unmanaged resources in a static class

2008-09-19 Thread Greg Young
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 ar

Re: [ADVANCED-DOTNET] Unmanaged resources in a static class

2008-09-19 Thread Trey Nash
Hi Simon, The answer to your questions is "Yes and No". :-) I'll explain both below: Yes: Finalizers will be called when the application domain is shutting down and/or when the CLR is shutting down. You can determine if this is the case by referencing the Environment.HasShutdownStarted proper

Re: [ADVANCED-DOTNET] Unmanaged resources in a static class

2008-09-19 Thread Shawn Wildermuth
There is another case (though an edge case) where Finalizaers aren't called. The case is where during tear-down of a process, if during calling of Finalizers is increasing memory usage (usually if someone is doing something bad), the GC will abort the Finalizations and just kill the whole heap. --