From 5ddc3b2286806068bbf63e048a177a121eaa99b5 Mon Sep 17 00:00:00 2001 From: "SND\\MaddTheSane_cp" Date: Sat, 20 Jul 2013 21:26:09 +0000 Subject: Fix debug messages when the debug file pointer isn't inited on OS X. This only affects the Debug build. git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@86181 e17a0e51-4ae3-4d35-97c3-1a29b211df97 --- macosx/main.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/macosx/main.m b/macosx/main.m index 2627f6d3..79949694 100755 --- a/macosx/main.m +++ b/macosx/main.m @@ -135,8 +135,8 @@ void SysPrintf(const char *fmt, ...) { if (Config.PsxOut) NSLog (@"%s", msg); #ifdef EMU_LOG #ifndef LOG_STDOUT - fprintf(emuLog, "%s %s: %s",[[debugDateFormatter() stringFromDate:[NSDate date]] UTF8String], - [[[NSBundle mainBundle]objectForInfoDictionaryKey:@"CFBundleName"] UTF8String], msg); + if (emuLog) fprintf(emuLog, "%s %s: %s",[[debugDateFormatter() stringFromDate:[NSDate date]] UTF8String], + [[[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"] UTF8String], msg); #endif #endif }; @@ -231,7 +231,10 @@ void SysClose() { powerAssertion = kIOPMNullAssertionID; } - if (emuLog != NULL) fclose(emuLog); + if (emuLog != NULL) { + fclose(emuLog); + emuLog = NULL; + } sysInited = NO; detachHotkeys(); -- cgit v1.2.3