mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- Fixed: Runtime error on Mac OS X. For whatever reason merely having the call to CFUserNotificationDisplayAlert() in I_FatalError caused exception handling to quit working. Moving it to a separate file seems to fix this. Also removed the warning about FRenderer having a non-virtual destructor.
SVN r3367 (trunk)
This commit is contained in:
parent
8f516a1007
commit
449bd90121
4 changed files with 26 additions and 16 deletions
|
@ -550,7 +550,7 @@ else( WIN32 )
|
|||
sdl/sdlvideo.cpp
|
||||
sdl/st_start.cpp )
|
||||
if( APPLE )
|
||||
set( SYSTEM_SOURCES ${SYSTEM_SOURCES} sdl/SDLMain.m sdl/iwadpicker_cocoa.mm )
|
||||
set( SYSTEM_SOURCES ${SYSTEM_SOURCES} sdl/SDLMain.m sdl/iwadpicker_cocoa.mm sdl/i_system_cocoa.mm )
|
||||
endif( APPLE )
|
||||
endif( WIN32 )
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ struct FRenderer
|
|||
Renderer = this;
|
||||
}
|
||||
|
||||
~FRenderer()
|
||||
virtual ~FRenderer()
|
||||
{
|
||||
Renderer = NULL;
|
||||
}
|
||||
|
|
|
@ -39,7 +39,6 @@
|
|||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include <mach/mach_init.h>
|
||||
#include <mach/semaphore.h>
|
||||
#include <mach/task.h>
|
||||
|
@ -382,6 +381,10 @@ void I_Quit (void)
|
|||
extern FILE *Logfile;
|
||||
bool gameisdead;
|
||||
|
||||
#ifdef __APPLE__
|
||||
void Mac_I_FatalError(const char* errortext);
|
||||
#endif
|
||||
|
||||
void STACK_ARGS I_FatalError (const char *error, ...)
|
||||
{
|
||||
static bool alreadyThrown = false;
|
||||
|
@ -398,19 +401,7 @@ void STACK_ARGS I_FatalError (const char *error, ...)
|
|||
va_end (argptr);
|
||||
|
||||
#ifdef __APPLE__
|
||||
// Close window or exit fullscreen and release mouse capture
|
||||
SDL_Quit();
|
||||
|
||||
const CFStringRef errorString = CFStringCreateWithCStringNoCopy( kCFAllocatorDefault,
|
||||
errortext, kCFStringEncodingASCII, kCFAllocatorNull );
|
||||
if ( NULL != errorString )
|
||||
{
|
||||
CFOptionFlags dummy;
|
||||
|
||||
CFUserNotificationDisplayAlert( 0, kCFUserNotificationStopAlertLevel, NULL, NULL, NULL,
|
||||
CFSTR( "Error" ), errorString, CFSTR( "Exit" ), NULL, NULL, &dummy );
|
||||
CFRelease( errorString );
|
||||
}
|
||||
Mac_I_FatalError(errortext);
|
||||
#endif // __APPLE__
|
||||
|
||||
// Record error to log (if logging)
|
||||
|
|
19
src/sdl/i_system_cocoa.mm
Normal file
19
src/sdl/i_system_cocoa.mm
Normal file
|
@ -0,0 +1,19 @@
|
|||
#include <CoreFoundation/CoreFoundation.h>
|
||||
#include "SDL.h"
|
||||
|
||||
void Mac_I_FatalError(const char* errortext)
|
||||
{
|
||||
// Close window or exit fullscreen and release mouse capture
|
||||
SDL_Quit();
|
||||
|
||||
const CFStringRef errorString = CFStringCreateWithCStringNoCopy( kCFAllocatorDefault,
|
||||
errortext, kCFStringEncodingASCII, kCFAllocatorNull );
|
||||
if ( NULL != errorString )
|
||||
{
|
||||
CFOptionFlags dummy;
|
||||
|
||||
CFUserNotificationDisplayAlert( 0, kCFUserNotificationStopAlertLevel, NULL, NULL, NULL,
|
||||
CFSTR( "Fatal Error" ), errorString, CFSTR( "Exit" ), NULL, NULL, &dummy );
|
||||
CFRelease( errorString );
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue