[Mono-devel-list] proposed patch for System.Configuration.ConfigurationSetting

Gonzalo Paniagua Javier gonzalo at ximian.com
Wed Nov 19 13:17:36 EST 2003


El mié, 19-11-2003 a las 18:35, eric lindvall escribió:
> sorry, forgot to cvs update first.

+		lock (typeof (DefaultConfig)) {
 			if (instance == null) {
-				instance = new DefaultConfig ();
-				instance.Init ();
+                               Interlocked.Exchange (
+                              ref instance, new DefaultConfig());}
-					

There's no need to use Interlocked here, as we're already inside a lock.

IMO, the changes to GetDocumentForSection are not needed. I vote for
leaving the current code as it is.

Also if I try to run an application that uses ConfigurationSettings and
there's no application configuration file (ie, only machine.config is
read), i get an exception:

Unhandled Exception: System.IO.FileNotFoundException: Could not find
file "/home/gpanjav/go-mono/appsettings.exe.config"

This should not happen.

-Gonzalo





More information about the Mono-devel-list mailing list