mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Implemented AppKit exception handler
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7598 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
a22296f346
commit
5f2683a975
3 changed files with 44 additions and 1 deletions
12
ChangeLog
12
ChangeLog
|
@ -1,3 +1,15 @@
|
|||
2000-09-26 Lyndon Tremblay <humasect@home.com>
|
||||
|
||||
* Source/NSApplication.m ([NSApplication +initialize]): Override
|
||||
Foundation's uncaught exception handler.
|
||||
|
||||
* Headers/AppKit/NSPanel.h (NSAlert*): #defines to comply
|
||||
with MacOS X [apparently].
|
||||
|
||||
* Source/NSApplication.m (_NSAppKitUncaughtExceptionHandler): Added
|
||||
to show unhandled exceptions to the user in a cleaner way,
|
||||
providing an option to ignore or debug [future use].
|
||||
|
||||
Tue Sep 26 09:36:07 2000 Nicola Pero <nicola@brainstorm.co.uk>
|
||||
|
||||
* NSControl.m ([-copyWithZone:]): Fixed memory problem (found
|
||||
|
|
|
@ -43,7 +43,12 @@ enum {
|
|||
NSAlertAlternateReturn = 0,
|
||||
NSAlertOtherReturn = -1,
|
||||
NSAlertErrorReturn = -2
|
||||
};
|
||||
};
|
||||
|
||||
// from MacOS X docs
|
||||
#define NSAlertDefault NSAlertDefaultReturn
|
||||
#define NSAlertAlternate NSAlertAlternateReturn
|
||||
#define NSAlertOther NSAlertOtherReturn
|
||||
|
||||
#ifndef STRICT_OPENSTEP
|
||||
#define NS_ALERTDEFAULT NSAlertDefaultReturn
|
||||
|
|
|
@ -68,6 +68,29 @@
|
|||
#include <AppKit/IMLoading.h>
|
||||
#include <AppKit/DPSOperators.h>
|
||||
|
||||
/*
|
||||
* AppKit exception handler (overrides Foundation)
|
||||
*/
|
||||
static void
|
||||
_NSAppKitUncaughtExceptionHandler (NSException *exception)
|
||||
{
|
||||
int retVal;
|
||||
|
||||
#ifdef DEBUG
|
||||
#define DEBUG_BUTTON @"Debug"
|
||||
#else
|
||||
#define DEBUG_BUTTON nil
|
||||
#endif
|
||||
|
||||
retVal = NSRunCriticalAlertPanel([[NSProcessInfo processInfo] processName],
|
||||
@"%@: %@",
|
||||
@"Abort", @"Ignore", DEBUG_BUTTON,
|
||||
[exception name], [exception reason]);
|
||||
|
||||
if (retVal == NSAlertDefault)
|
||||
abort();
|
||||
}
|
||||
|
||||
/*
|
||||
* Types
|
||||
*/
|
||||
|
@ -250,6 +273,9 @@ static NSCell* tileCell = nil;
|
|||
* can prevent -release loops
|
||||
*/
|
||||
gnustep_gui_app_is_in_dealloc = NO;
|
||||
|
||||
// Set the AppKit exception handler.
|
||||
_NSUncaughtExceptionHandler = _NSAppKitUncaughtExceptionHandler;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue