[Mono.Cairo] Don't log warnings during VM shutdown
authorMichael Hutchinson <m.j.hutchinson@gmail.com>
Sat, 29 Jun 2013 09:26:41 +0000 (05:26 -0400)
committerMichael Hutchinson <m.j.hutchinson@gmail.com>
Sat, 29 Jun 2013 09:29:11 +0000 (05:29 -0400)
Else it can explode pretty badly if the Console streams are
finalized before the Cairo objects.

mcs/class/Mono.Cairo/Mono.Cairo/CairoDebug.cs

index 43b370f8b060587dba82c72ed167781c0769049b..d694bbb545112665c1c988b8afbacd4c46bfe1be 100644 (file)
@@ -58,6 +58,9 @@ namespace Cairo {
                        if (disposing && !Enabled)
                                throw new InvalidOperationException ();
 
+                       if (Environment.HasShutdownStarted)
+                               return;
+
                        if (!disposing) {
                                Console.Error.WriteLine ("{0} is leaking, programmer is missing a call to Dispose", typeof(T).FullName);
                                if (Enabled) {