From c54d34a692034753a2b8d86e687320272d834094 Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 11 May 1999 10:11:48 +0000 Subject: [PATCH] Fixed error in release of bundles that shouldn't be deallocated. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4239 72102866-910b-0410-8b05-ffd578937521 --- Source/NSBundle.m | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Source/NSBundle.m b/Source/NSBundle.m index 3d48a0521..11868555e 100644 --- a/Source/NSBundle.m +++ b/Source/NSBundle.m @@ -275,7 +275,7 @@ _bundle_load_callback(Class theClass, Category *theCategory) mutableCopy]); [system appendString: @"/Libraries"]; - _gnustep_bundle = [NSBundle bundleWithPath: system]; + _gnustep_bundle = RETAIN([NSBundle bundleWithPath: system]); } } } @@ -458,7 +458,7 @@ _bundle_load_callback(Class theClass, Category *theCategory) { if (_codeLoaded == YES || self == _mainBundle || self == _gnustep_bundle) { - if ([self retainCount] == 0) + if ([self retainCount] == 1) { if (self == NSMapGet(_releasedBundles, _path)) { @@ -481,12 +481,9 @@ _bundle_load_callback(Class theClass, Category *theCategory) NSMapRemove(_bundles, _path); RELEASE(_path); } - if (_bundleClasses) - RELEASE(_bundleClasses); - if (_infoDict) - RELEASE(_infoDict); - if (_localizations) - RELEASE(_localizations); + TEST_RELEASE(_bundleClasses); + TEST_RELEASE(_infoDict); + TEST_RELEASE(_localizations); [super dealloc]; } @@ -945,11 +942,9 @@ _bundle_load_callback(Class theClass, Category *theCategory) */ pInfo = [NSProcessInfo processInfo]; env = [pInfo environment]; - user = AUTORELEASE([[env objectForKey: @"GNUSTEP_USER_ROOT"] - mutableCopy]); + user = AUTORELEASE([[env objectForKey: @"GNUSTEP_USER_ROOT"] mutableCopy]); [user appendString: @"/Libraries"]; - local = AUTORELEASE([[env objectForKey: @"GNUSTEP_LOCAL_ROOT"] - mutableCopy]); + local = AUTORELEASE([[env objectForKey: @"GNUSTEP_LOCAL_ROOT"] mutableCopy]); [local appendString: @"/Libraries"]; if (user)