Warning message when horizontal typesetter enters multiple levels of recursion

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/branches/gnustep_testplant_branch@38296 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Paul Landers 2015-01-17 00:08:39 +00:00
parent 9785d080af
commit 0f6f11e24d

View file

@ -1214,6 +1214,12 @@ restart: ;
/* Since we might be the shared system typesetter, we must be /* Since we might be the shared system typesetter, we must be
reentrant. Thus, if we are already in use and can't lock our lock, reentrant. Thus, if we are already in use and can't lock our lock,
we create a new instance and let it handle the call. */ we create a new instance and let it handle the call. */
static NSUInteger RecursionCount = 0;
RecursionCount++;
if (RecursionCount > 1)
NSLog(@"%s:entering %d level recursion", __PRETTY_FUNCTION__, RecursionCount);
GSHorizontalTypesetter *temp; GSHorizontalTypesetter *temp;
temp = [[object_getClass(self) alloc] init]; temp = [[object_getClass(self) alloc] init];
@ -1224,6 +1230,9 @@ restart: ;
nextGlyphIndex: nextGlyphIndex nextGlyphIndex: nextGlyphIndex
numberOfLineFragments: howMany]; numberOfLineFragments: howMany];
DESTROY(temp); DESTROY(temp);
RecursionCount--;
return ret; return ret;
} }