From 099fd1c6e802b9c283668084cdba02da93966707 Mon Sep 17 00:00:00 2001 From: richard Date: Sat, 12 Dec 1998 20:52:36 +0000 Subject: [PATCH] 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 --- Source/NSUserDefaults.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/NSUserDefaults.m b/Source/NSUserDefaults.m index c90e82de5..e88d8e9a4 100644 --- a/Source/NSUserDefaults.m +++ b/Source/NSUserDefaults.m @@ -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];