Avoid leaking NXConstantStrings

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@4452 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 1999-06-21 19:54:43 +00:00
parent 4a690610ec
commit 1158a581b1
2 changed files with 15 additions and 8 deletions

View file

@ -697,7 +697,7 @@ handle_printf_atsign (FILE *stream,
[self getCharacters: s];
[aString getCharacters: s+len];
tmp = [[[self class] allocWithZone: z] initWithCharactersNoCopy: s
tmp = [[NSString_concrete_class allocWithZone: z] initWithCharactersNoCopy: s
length: len+otherLength fromZone: z];
return AUTORELEASE(tmp);
}
@ -763,7 +763,7 @@ handle_printf_atsign (FILE *stream,
z = fastZone(self);
buf = NSZoneMalloc(z, sizeof(unichar)*aRange.length);
[self getCharacters: buf range: aRange];
ret = [[[self class] allocWithZone: NSDefaultMallocZone()]
ret = [[NSString_concrete_class allocWithZone: NSDefaultMallocZone()]
initWithCharactersNoCopy: buf length: aRange.length fromZone: z];
return AUTORELEASE(ret);
}
@ -1293,7 +1293,8 @@ handle_printf_atsign (FILE *stream,
s = NSZoneMalloc(z, sizeof(unichar)*(len+1));
for (count = 0; count < len; count++)
s[count] = uni_tolower([self characterAtIndex: count]);
return AUTORELEASE([[[self class] allocWithZone: NSDefaultMallocZone()]
return AUTORELEASE([[NSString_concrete_class
allocWithZone: NSDefaultMallocZone()]
initWithCharactersNoCopy: s length: len fromZone: z]);
}
@ -1307,7 +1308,8 @@ handle_printf_atsign (FILE *stream,
s = NSZoneMalloc(z, sizeof(unichar)*(len+1));
for (count = 0; count < len; count++)
s[count] = uni_toupper([self characterAtIndex: count]);
return AUTORELEASE([[[self class] allocWithZone: NSDefaultMallocZone()]
return AUTORELEASE([[NSString_concrete_class
allocWithZone: NSDefaultMallocZone()]
initWithCharactersNoCopy: s length: len fromZone: z]);
}