From e3e8fb8deab8cb8effc1ac50adb911c309a2c3cb Mon Sep 17 00:00:00 2001 From: theraven Date: Mon, 19 Jul 2010 17:10:46 +0000 Subject: [PATCH] Added a hack to allow the stuff GSString caches to be re-cached. Ideally we wouldn't be caching any of this stuff (or, with libobjc2, we'd be using the slot mechanism to invalidate the cache when required). git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31005 72102866-910b-0410-8b05-ffd578937521 --- Source/GSString.m | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/GSString.m b/Source/GSString.m index 354c1e96c..776404d2c 100644 --- a/Source/GSString.m +++ b/Source/GSString.m @@ -247,11 +247,11 @@ static NSStringEncoding internalEncoding = NSISOLatin1StringEncoding; * initialized, and caches classes and some method implementations. */ static void -setup(void) +setup(BOOL rerun) { static BOOL beenHere = NO; - if (beenHere == NO) + if (!beenHere || rerun) { beenHere = YES; @@ -325,7 +325,7 @@ static void getCString_u(GSStr self, char *buffer, unsigned int maxLength, @implementation GSPlaceholderString + (void) initialize { - setup(); + setup(NO); } - (id) autorelease @@ -2817,7 +2817,11 @@ transmute(GSStr self, NSString *aString) + (void) initialize { - setup(); + setup(NO); +} ++ (void) reinitialize +{ + setup(YES); } /* @@ -3637,7 +3641,7 @@ agree, create a new GSUnicodeInlineString otherwise. + (void) initialize { - setup(); + setup(NO); GSObjCAddClassBehavior(self, [GSString class]); }