Author: rfm
Date: Sun Apr 24 13:30:22 2016
New Revision: 39691

URL: http://svn.gna.org/viewcvs/gnustep?rev=39691&view=rev
Log:
raise exception for alte registration.

Modified:
    libs/ec/trunk/EcProcess.m

Modified: libs/ec/trunk/EcProcess.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/ec/trunk/EcProcess.m?rev=39691&r1=39690&r2=39691&view=diff
==============================================================================
--- libs/ec/trunk/EcProcess.m   (original)
+++ libs/ec/trunk/EcProcess.m   Sun Apr 24 13:30:22 2016
@@ -5224,6 +5224,7 @@
 @implementation EcDefaultRegistration
 
 static NSMutableDictionary      *regDefs = nil;
+static BOOL                     merged = NO;
 
 + (void) defaultsChanged: (NSUserDefaults*)defs
 {
@@ -5348,6 +5349,7 @@
       m = [NSMutableDictionary dictionaryWithCapacity: [regDefs count]];
     }
   [ecLock lock];
+  merged = YES;
   e = [regDefs keyEnumerator];
   while (nil != (k = [e nextObject]))
     {
@@ -5370,6 +5372,7 @@
 {
   static NSCharacterSet *w = nil;
   EcDefaultRegistration *d;
+  BOOL                  alreadyMerged;
 
   if (nil == w)
     {
@@ -5414,6 +5417,7 @@
     }
 
   [ecLock lock];
+  alreadyMerged = merged;
   d = [regDefs objectForKey: name];
   if (nil == d)
     {
@@ -5430,6 +5434,12 @@
     }
   ASSIGNCOPY(d->val, value);
   [ecLock unlock];
+  if (YES == alreadyMerged && nil != d->val)
+    {
+      [NSException raise: NSInternalInconsistencyException
+                  format: @"default '%@' value '%@' registered too late",
+        d->name, d->val];
+    }
 }
 
 + (void) showHelp


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to