Fix bug 24320

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@26907 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2008-10-11 06:30:03 +00:00
parent 15785db04b
commit 33a4784b8e
2 changed files with 28 additions and 2 deletions

View file

@ -1,3 +1,7 @@
2008-10-11 Eric Wasylishen
* Source/NSBundle.m: fix bug #24320
2008-10-10 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSTimeZones/NSTimeZones.tar: updated.

View file

@ -692,8 +692,30 @@ _find_main_bundle_for_tool(NSString *toolName)
*/
if (_loadingBundle != nil && _loadingBundle != bundle)
{
[_loadingBundle->_bundleClasses
removeObjectsInArray: bundle->_bundleClasses];
int i, j;
id b = bundle->_bundleClasses;
id l = _loadingBundle->_bundleClasses;
/* The following essentially does:
*
* [_loadingBundle->_bundleClasses
* removeObjectsInArray: bundle->_bundleClasses];
*
* The problem with that code is isEqual: gets
* sent to the classes, which will cause them to be
* initialized (which should not happen.)
*/
for (i = 0; i < [b count]; i++)
{
for (j = 0; j < [l count]; j++)
{
if ([[l objectAtIndex: j] nonretainedObjectValue]
== [[b objectAtIndex:i] nonretainedObjectValue])
{
[l removeObjectAtIndex:j];
}
}
}
}
}
}