mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 09:04:13 +00:00
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:
parent
5e28169539
commit
d3ff82c343
1 changed files with 4 additions and 2 deletions
|
@ -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];
|
||||
|
||||
|
|
Loading…
Reference in a new issue