Small tidyup in NSBundle +initialize

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@24913 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
nicola 2007-03-21 13:11:45 +00:00
parent 56b7d94f6a
commit 8a44053afb
2 changed files with 70 additions and 61 deletions

View file

@ -1,3 +1,7 @@
2007-03-21 Nicola Pero <nicola.pero@meta-innovation.com>
* Source/NSBundle.m ([+initialize]): Removed unused check.
2007-03-20 Nicola Pero <nicola.pero@meta-innovation.com>
* Source/NSUserDefaults.m ([+standardUserDefaults]): Fixed bug

View file

@ -774,17 +774,23 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
if (self == [NSBundle class])
{
NSDictionary *env;
NSString *str;
_emptyTable = RETAIN([NSDictionary dictionary]);
/* Need to make this recursive since both mainBundle and initWithPath:
want to lock the thread */
/* Need to make this recursive since both mainBundle and
* initWithPath: want to lock the thread.
*/
load_lock = [NSRecursiveLock new];
env = [[NSProcessInfo processInfo] environment];
if (env)
{
NSString *str;
/* These variables are used when we are running non-flattened.
* This means that there are multiple binaries for different
* OSes, and we need constantly to choose the right one (eg,
* when loading a bundle or a framework). The choice is based
* on these environments variables that are set by GNUstep.sh
* (you must source GNUstep.sh when non-flattened).
*/
if ((str = [env objectForKey: @"GNUSTEP_TARGET_CPU"]) != nil)
gnustep_target_cpu = RETAIN(str);
else if ((str = [env objectForKey: @"GNUSTEP_HOST_CPU"]) != nil)
@ -855,7 +861,6 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
#endif
}
}
}
/**
* Returns an array of all the bundles which do not belong to frameworks.<br />