mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +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
da486ddbc5
commit
099fd1c6e8
1 changed files with 4 additions and 2 deletions
|
@ -87,9 +87,11 @@ static NSMutableString *processName = nil;
|
||||||
convenience; other instances may also be created.
|
convenience; other instances may also be created.
|
||||||
*/
|
*/
|
||||||
{
|
{
|
||||||
if (sharedDefaults)
|
static BOOL beenHere = NO; /* Flag to prevent infinite recursion */
|
||||||
|
|
||||||
|
if (beenHere)
|
||||||
return sharedDefaults;
|
return sharedDefaults;
|
||||||
|
beenHere = YES;
|
||||||
// Create new sharedDefaults (NOTE: Not added to the autorelease pool!)
|
// Create new sharedDefaults (NOTE: Not added to the autorelease pool!)
|
||||||
sharedDefaults = [[self alloc] init];
|
sharedDefaults = [[self alloc] init];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue