mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Fix another leak spotted by Quentin
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@31779 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
2671ff98e5
commit
d4558f5db1
2 changed files with 13 additions and 8 deletions
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
* Source/NSString.m:
|
* Source/NSString.m:
|
||||||
([-stringByReplacingCharactersInRange:withString:]) fix memory leak.
|
([-stringByReplacingCharactersInRange:withString:]) fix memory leak.
|
||||||
|
([-stringByReplacingOccurrencesOfString:withString:options:range:])
|
||||||
|
ditto.
|
||||||
|
|
||||||
2010-12-25 Quentin Mathe <quentin.mathe@gmail.com>
|
2010-12-25 Quentin Mathe <quentin.mathe@gmail.com>
|
||||||
|
|
||||||
|
|
|
@ -1774,21 +1774,24 @@ handle_printf_atsign (FILE *stream,
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString*)stringByReplacingOccurrencesOfString: (NSString*)replace
|
- (NSString*) stringByReplacingOccurrencesOfString: (NSString*)replace
|
||||||
withString: (NSString*)by
|
withString: (NSString*)by
|
||||||
options: (NSStringCompareOptions)opts
|
options: (NSStringCompareOptions)opts
|
||||||
range: (NSRange)searchRange
|
range: (NSRange)searchRange
|
||||||
{
|
{
|
||||||
id copy = [self mutableCopy];
|
id copy;
|
||||||
|
|
||||||
|
copy = [[GSMutableStringClass allocWithZone: NSDefaultMallocZone()]
|
||||||
|
initWithString: self];
|
||||||
[copy replaceOccurrencesOfString: replace
|
[copy replaceOccurrencesOfString: replace
|
||||||
withString: by
|
withString: by
|
||||||
options: opts
|
options: opts
|
||||||
range: searchRange];
|
range: searchRange];
|
||||||
return [copy makeImmutableCopyOnFail: NO];
|
return [[copy makeImmutableCopyOnFail: NO] autorelease];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSString*)stringByReplacingOccurrencesOfString: (NSString*)replace
|
- (NSString*) stringByReplacingOccurrencesOfString: (NSString*)replace
|
||||||
withString: (NSString*)by
|
withString: (NSString*)by
|
||||||
{
|
{
|
||||||
return [self
|
return [self
|
||||||
stringByReplacingOccurrencesOfString: replace
|
stringByReplacingOccurrencesOfString: replace
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue