mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-26 04:41:10 +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);
|
RTFAttribute *new = (RTFAttribute *)NSCopyObject (self, 0, zone);
|
||||||
|
|
||||||
new->paragraph = [paragraph copyWithZone: zone];
|
new->paragraph = [paragraph copyWithZone: zone];
|
||||||
new->fontName = [fontName copyWithZone: zone];
|
RETAIN(new->fontName);
|
||||||
|
RETAIN(new->fgColour);
|
||||||
|
RETAIN(new->bgColour);
|
||||||
|
|
||||||
return new;
|
return new;
|
||||||
}
|
}
|
||||||
|
@ -304,6 +306,7 @@ readNSString(StringContext *ctxt)
|
||||||
ASSIGN(attrs, [NSMutableArray array]);
|
ASSIGN(attrs, [NSMutableArray array]);
|
||||||
ASSIGN(colours, [NSMutableArray array]);
|
ASSIGN(colours, [NSMutableArray array]);
|
||||||
[attrs addObject: attr];
|
[attrs addObject: attr];
|
||||||
|
RELEASE(attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (RTFAttribute*) attr
|
- (RTFAttribute*) attr
|
||||||
|
@ -313,7 +316,10 @@ readNSString(StringContext *ctxt)
|
||||||
|
|
||||||
- (void) push
|
- (void) push
|
||||||
{
|
{
|
||||||
[attrs addObject: [[attrs lastObject] copy]];
|
RTFAttribute *attr = [[attrs lastObject] copy];
|
||||||
|
|
||||||
|
[attrs addObject: attr];
|
||||||
|
RELEASE(attr);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) pop
|
- (void) pop
|
||||||
|
@ -351,6 +357,7 @@ readNSString(StringContext *ctxt)
|
||||||
//[localException raise];
|
//[localException raise];
|
||||||
NS_ENDHANDLER
|
NS_ENDHANDLER
|
||||||
|
|
||||||
|
RELEASE(rtfString);
|
||||||
RELEASE(pool);
|
RELEASE(pool);
|
||||||
// document attributes
|
// document attributes
|
||||||
if (dict)
|
if (dict)
|
||||||
|
|
Loading…
Reference in a new issue