mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 17:21:02 +00:00
Improved the memory handling in diverse methods.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7821 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d5349e07f5
commit
7b3fe023bc
1 changed files with 9 additions and 2 deletions
|
@ -102,7 +102,9 @@ readNSString(StringContext *ctxt)
|
|||
RTFAttribute *new = (RTFAttribute *)NSCopyObject (self, 0, zone);
|
||||
|
||||
new->paragraph = [paragraph copyWithZone: zone];
|
||||
new->fontName = [fontName copyWithZone: zone];
|
||||
RETAIN(new->fontName);
|
||||
RETAIN(new->fgColour);
|
||||
RETAIN(new->bgColour);
|
||||
|
||||
return new;
|
||||
}
|
||||
|
@ -304,6 +306,7 @@ readNSString(StringContext *ctxt)
|
|||
ASSIGN(attrs, [NSMutableArray array]);
|
||||
ASSIGN(colours, [NSMutableArray array]);
|
||||
[attrs addObject: attr];
|
||||
RELEASE(attr);
|
||||
}
|
||||
|
||||
- (RTFAttribute*) attr
|
||||
|
@ -313,7 +316,10 @@ readNSString(StringContext *ctxt)
|
|||
|
||||
- (void) push
|
||||
{
|
||||
[attrs addObject: [[attrs lastObject] copy]];
|
||||
RTFAttribute *attr = [[attrs lastObject] copy];
|
||||
|
||||
[attrs addObject: attr];
|
||||
RELEASE(attr);
|
||||
}
|
||||
|
||||
- (void) pop
|
||||
|
@ -351,6 +357,7 @@ readNSString(StringContext *ctxt)
|
|||
//[localException raise];
|
||||
NS_ENDHANDLER
|
||||
|
||||
RELEASE(rtfString);
|
||||
RELEASE(pool);
|
||||
// document attributes
|
||||
if (dict)
|
||||
|
|
Loading…
Reference in a new issue