(-removeTextContainerAtIndex:): Set textcontainers to NULL after freeing it.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@15837 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Alexander Malmberg 2003-02-01 02:32:03 +00:00
parent 7d026d8e37
commit 64671d7b86
2 changed files with 17 additions and 2 deletions

View file

@ -1,3 +1,12 @@
2003-02-01 03:26 Alexander Malmberg <alexander@malmberg.org>
* Source/GSLayoutManager.m (-removeTextContainerAtIndex:): Set
textcontainers to NULL after freeing it. Clean up some other
malloc-stuff.
* Source/NSTextContainer.m (-replaceLayoutManager:): Remove the
containers from the correct layout manager.
2003-01-31 Fred Kiefer <FredKiefer@gmx.de>
* Headers/AppKit/GSDisplayServer.h

View file

@ -1436,6 +1436,8 @@ it should still be safe. might lose opportunities to merge runs, though.
{
if (lf->points)
free(lf->points);
if (lf->attachments)
free(lf->attachments);
}
tc->num_linefrags = idx;
tc->length = tc->linefrags[idx - 1].pos + tc->linefrags[idx - 1].length - tc->pos;
@ -1887,6 +1889,7 @@ forStartOfGlyphRange: (NSRange)glyphRange
/* TODO: make more efficient */
- (NSArray *) textContainers
{
NSMutableArray *ma;
@ -1942,10 +1945,12 @@ forStartOfGlyphRange: (NSRange)glyphRange
textcontainers = realloc(textcontainers,
sizeof(textcontainer_t) * num_textcontainers);
else
free(textcontainers);
{
free(textcontainers);
textcontainers = NULL;
}
}
- (void) textContainerChangedGeometry: (NSTextContainer *)aContainer
{
int i;
@ -2015,6 +2020,7 @@ forStartOfGlyphRange: (NSRange)glyphRange
[tc->textContainer release];
}
free(textcontainers);
textcontainers = NULL;
[self _freeGlyphs];