mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-25 05:01:00 +00:00
Fixed dealloc so that it can dealloc a layout manager which has not been
-init git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12484 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8e7bfb06a7
commit
90f3074971
1 changed files with 28 additions and 16 deletions
|
@ -585,7 +585,9 @@ _Sane(NSLayoutManager *lm)
|
||||||
*/
|
*/
|
||||||
- (id) init
|
- (id) init
|
||||||
{
|
{
|
||||||
if ([super init] != nil)
|
self = [super init];
|
||||||
|
|
||||||
|
if (self != nil)
|
||||||
{
|
{
|
||||||
GSIArray a;
|
GSIArray a;
|
||||||
|
|
||||||
|
@ -621,9 +623,16 @@ _Sane(NSLayoutManager *lm)
|
||||||
{
|
{
|
||||||
unsigned i;
|
unsigned i;
|
||||||
|
|
||||||
/*
|
/* We check that the _glyphData and _glyphGaps are not NULL so that
|
||||||
* Release all glyph chunk information
|
* we can dealloc an object which has not been -init (some
|
||||||
|
* regression tests need it).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Release all glyph chunk information.
|
||||||
|
*/
|
||||||
|
if (_glyphData != NULL)
|
||||||
|
{
|
||||||
i = GSIArrayCount(glyphChunks);
|
i = GSIArrayCount(glyphChunks);
|
||||||
while (i-- > 0)
|
while (i-- > 0)
|
||||||
{
|
{
|
||||||
|
@ -634,10 +643,13 @@ _Sane(NSLayoutManager *lm)
|
||||||
}
|
}
|
||||||
GSIArrayEmpty(glyphChunks);
|
GSIArrayEmpty(glyphChunks);
|
||||||
NSZoneFree(NSDefaultMallocZone(), _glyphData);
|
NSZoneFree(NSDefaultMallocZone(), _glyphData);
|
||||||
_glyphData = 0;
|
}
|
||||||
|
|
||||||
|
if (_glyphGaps != NULL)
|
||||||
|
{
|
||||||
GSIArrayEmpty((GSIArray)_glyphGaps);
|
GSIArrayEmpty((GSIArray)_glyphGaps);
|
||||||
NSZoneFree(NSDefaultMallocZone(), _glyphGaps);
|
NSZoneFree(NSDefaultMallocZone(), _glyphGaps);
|
||||||
|
}
|
||||||
|
|
||||||
RELEASE (_textContainers);
|
RELEASE (_textContainers);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue