Exceptyion handler tweak for gui termination.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@25164 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
rfm 2007-05-15 12:53:33 +00:00
parent a7f86a2a91
commit ae971f5849
2 changed files with 13 additions and 7 deletions

View file

@ -1,3 +1,11 @@
2007-05-15 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSException.m: Permit some recursion in handling uncaught
exceptions so that different exception handlers can be tried ...
in particular, so that the gui library exception handler can
fall back to using the base library handler and get a printout of
the exception details when the program terminates.
2007-05-15 Richard Frith-Macdonald <rfm@gnu.org> 2007-05-15 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSURLConnection.m: Minor simplifications. * Source/NSURLConnection.m: Minor simplifications.

View file

@ -809,16 +809,14 @@ _NSFoundationUncaughtExceptionHandler (NSException *exception)
handler = thread->_exception_handler; handler = thread->_exception_handler;
if (handler == NULL) if (handler == NULL)
{ {
static BOOL recursion = NO; static int recursion = 0;
/* /*
* Set a flag to prevent recursive uncaught exceptions. * Set/check a counter to prevent recursive uncaught exceptions.
* Allow a little recursion in case we have different handlers
* being tried.
*/ */
if (recursion == NO) if (recursion++ > 3)
{
recursion = YES;
}
else
{ {
fprintf(stderr, fprintf(stderr,
"recursion encountered handling uncaught exception\n"); "recursion encountered handling uncaught exception\n");