Avoid infinite recursion on initialisation failure.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@3442 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1998-12-12 20:52:36 +00:00
parent da486ddbc5
commit 099fd1c6e8

View file

@ -87,9 +87,11 @@ static NSMutableString *processName = nil;
convenience; other instances may also be created.
*/
{
if (sharedDefaults)
static BOOL beenHere = NO; /* Flag to prevent infinite recursion */
if (beenHere)
return sharedDefaults;
beenHere = YES;
// Create new sharedDefaults (NOTE: Not added to the autorelease pool!)
sharedDefaults = [[self alloc] init];