Author: rfm
Date: Fri Apr 8 16:01:24 2016
New Revision: 39650
URL: http://svn.gna.org/viewcvs/gnustep?rev=39650&view=rev
Log:
add some consistency checks
Modified:
libs/base/trunk/Source/NSUserDefaults.m
Modified: libs/base/trunk/Source/NSUserDefaults.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/NSUserDefaults.m?rev=39650&r1=39649&r2=39650&view=diff
==============================================================================
--- libs/base/trunk/Source/NSUserDefaults.m (original)
+++ libs/base/trunk/Source/NSUserDefaults.m Fri Apr 8 16:01:24 2016
@@ -89,7 +89,7 @@
static NSUserDefaults *sharedDefaults = nil;
static NSDictionary *argumentsDictionary = nil;
-static NSMutableString *processName = nil;
+static NSString *processName = nil;
static NSRecursiveLock *classLock = nil;
static NSLock *syncLock = nil;
@@ -585,6 +585,8 @@
argumentsDictionary = [NSDictionary new];
[self registerAtExit];
+ processName = [[[NSProcessInfo processInfo] processName] copy];
+
/* Initialise the defaults flags to take values from the
* process arguments. These are otherwise set in updateCache()
* We do this early on so that the boolean argument settings can
@@ -1130,16 +1132,6 @@
BOOL flag;
self = [super init];
-
- /*
- * Global variable.
- */
- if (processName == nil)
- {
- NSString *s = [[NSProcessInfo processInfo] processName];
-
- processName = [s copy];
- }
if (path == nil || [path isEqual: @""] == YES)
{
@@ -2293,6 +2285,7 @@
- (void) _changePersistentDomain: (NSString*)domainName
{
+ NSAssert(nil != domainName, NSInvalidArgumentException);
[_lock lock];
NS_DURING
{
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs