mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
2002-10-25 Mirko Viviani <mirko.viviani@rccr.cremona.it>
* Source/NSBundle.m ([NSBundle -load]): set _codeLoaded before loading the bundle. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14839 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
23a60ca711
commit
7dbab5bdc9
2 changed files with 24 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
2002-10-25 Mirko Viviani <mirko.viviani@rccr.cremona.it>
|
||||
|
||||
* Source/NSBundle.m ([NSBundle -load]): set _codeLoaded before loading
|
||||
the bundle.
|
||||
|
||||
2002-10-22 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Tools/AGSParser.m: Avoid duplication of method comments when
|
||||
|
|
|
@ -338,7 +338,7 @@ _bundle_name_first_match(NSString* directory, NSString* name)
|
|||
|
||||
/* Try creating the bundle. */
|
||||
bundle = [[self alloc] initWithPath: bundlePath];
|
||||
|
||||
|
||||
if (bundle == nil)
|
||||
{
|
||||
/* TODO: We couldn't locate the framework in the expected
|
||||
|
@ -385,6 +385,15 @@ _bundle_name_first_match(NSString* directory, NSString* name)
|
|||
|
||||
@end
|
||||
|
||||
/*
|
||||
Mirko:
|
||||
|
||||
The gnu-runtime calls the +load method of each class before the
|
||||
_bundle_load_callback() is called and we can't provide the list of classes
|
||||
ready for this method.
|
||||
|
||||
*/
|
||||
|
||||
void
|
||||
_bundle_load_callback(Class theClass, struct objc_category *theCategory)
|
||||
{
|
||||
|
@ -900,13 +909,13 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
|
|||
|
||||
- (BOOL) load
|
||||
{
|
||||
if (self == _mainBundle || self == _gnustep_bundle)
|
||||
if (self == _mainBundle || self == _gnustep_bundle)
|
||||
{
|
||||
_codeLoaded = YES;
|
||||
return YES;
|
||||
}
|
||||
|
||||
[load_lock lock];
|
||||
|
||||
if (!_codeLoaded)
|
||||
{
|
||||
NSString *object, *path;
|
||||
|
@ -937,15 +946,21 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
|
|||
_loadingBundle = self;
|
||||
_bundleClasses = RETAIN([NSMutableArray arrayWithCapacity: 2]);
|
||||
_loadingFrameworks = RETAIN([NSMutableArray arrayWithCapacity: 2]);
|
||||
|
||||
/* This code is executed twice if a class linked in the bundle call a
|
||||
NSBundle method inside +load (-principalClass). To avoid this we set
|
||||
_codeLoaded before loading the bundle. */
|
||||
_codeLoaded = YES;
|
||||
|
||||
if (objc_load_module([object fileSystemRepresentation],
|
||||
stderr, _bundle_load_callback, NULL, NULL))
|
||||
{
|
||||
_codeLoaded = NO;
|
||||
DESTROY(_loadingFrameworks);
|
||||
DESTROY(_currentFrameworkName);
|
||||
[load_lock unlock];
|
||||
return NO;
|
||||
}
|
||||
_codeLoaded = YES;
|
||||
|
||||
/* We now construct the list of bundles from frameworks linked with
|
||||
this one */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue