mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-24 11:40:47 +00:00
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:
parent
f861ed56f7
commit
51b404929f
1 changed files with 14 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue