Fixed logging exception when no graphics context exists

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@8618 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2001-01-16 12:36:32 +00:00
parent f861ed56f7
commit 51b404929f

View file

@ -71,6 +71,12 @@
#include <AppKit/NSDataLinkPanel.h>
#include <AppKit/NSHelpPanel.h>
/* Prevent recursion handler */
static void
_preventRecursion (NSException *exception)
{
}
/*
* Base library exception handler
*/
@ -95,12 +101,16 @@ _NSAppKitUncaughtExceptionHandler (NSException *exception)
NSSetUncaughtExceptionHandler (defaultUncaughtExceptionHandler);
/*
* If there is no graphics context to run the alert panel in,
* use the default exception handler.
*/
* If there is no graphics context to run the alert panel in, just
* quit. */
if (GSCurrentContext() == nil)
{
defaultUncaughtExceptionHandler (exception);
_NSUncaughtExceptionHandler = _preventRecursion;
fprintf (stderr,
"Uncaught exception %s, reason: %s\n",
[[exception name] lossyCString],
[[exception reason] lossyCString]);
abort();
}
retVal = NSRunCriticalAlertPanel