| @@ -90,6 +90,13 @@ | |||||
| #define JUCE_ZLIB_INCLUDE_PATH <zlib.h> | #define JUCE_ZLIB_INCLUDE_PATH <zlib.h> | ||||
| #endif | #endif | ||||
| /* Config: JUCE_CATCH_UNHANDLED_EXCEPTIONS | |||||
| If enabled, this will add some exception-catching code to forward unhandled exceptions | |||||
| to your JUCEApplication::unhandledException() callback. | |||||
| */ | |||||
| #ifndef JUCE_CATCH_UNHANDLED_EXCEPTIONS | |||||
| //#define JUCE_CATCH_UNHANDLED_EXCEPTIONS 1 | |||||
| #endif | |||||
| //============================================================================= | //============================================================================= | ||||
| //============================================================================= | //============================================================================= | ||||
| @@ -682,11 +682,16 @@ public: | |||||
| #if JUCE_IOS | #if JUCE_IOS | ||||
| handle = 1; // On iOS we can't run multiple apps, so just assume success. | handle = 1; // On iOS we can't run multiple apps, so just assume success. | ||||
| #else | #else | ||||
| // Note that we can't get the normal temp folder here, as it might be different for each app. | |||||
| File tempFolder ("/var/tmp"); | |||||
| if (! tempFolder.isDirectory()) | |||||
| tempFolder = "/tmp"; | |||||
| // Note that we can't get the normal temp folder here, as it might be different for each app. | |||||
| #if JUCE_MAC | |||||
| File tempFolder ("~/Library/Caches/com.juce.locks"); | |||||
| #else | |||||
| File tempFolder ("/var/tmp"); | |||||
| if (! tempFolder.isDirectory()) | |||||
| tempFolder = "/tmp"; | |||||
| #endif | |||||
| const File temp (tempFolder.getChildFile (name)); | const File temp (tempFolder.getChildFile (name)); | ||||
| @@ -205,7 +205,7 @@ | |||||
| #define JUCE_CATCH_ALL catch (...) {} | #define JUCE_CATCH_ALL catch (...) {} | ||||
| #define JUCE_CATCH_ALL_ASSERT catch (...) { jassertfalse; } | #define JUCE_CATCH_ALL_ASSERT catch (...) { jassertfalse; } | ||||
| #if JUCE_ONLY_BUILD_CORE_LIBRARY | |||||
| #if ! JUCE_MODULE_AVAILABLE_juce_gui_basics | |||||
| #define JUCE_CATCH_EXCEPTION JUCE_CATCH_ALL | #define JUCE_CATCH_EXCEPTION JUCE_CATCH_ALL | ||||
| #else | #else | ||||
| /** Used in try-catch blocks, this macro will send exceptions to the JUCEApplication | /** Used in try-catch blocks, this macro will send exceptions to the JUCEApplication | ||||
| @@ -39,6 +39,10 @@ | |||||
| #include "../juce_core/native/juce_BasicNativeHeaders.h" | #include "../juce_core/native/juce_BasicNativeHeaders.h" | ||||
| #include "juce_events.h" | #include "juce_events.h" | ||||
| #if JUCE_CATCH_UNHANDLED_EXCEPTIONS && JUCE_MODULE_AVAILABLE_juce_gui_basics | |||||
| #include "../juce_gui_basics/juce_gui_basics.h" | |||||
| #endif | |||||
| //============================================================================== | //============================================================================== | ||||
| #if JUCE_MAC | #if JUCE_MAC | ||||
| #import <IOKit/IOKitLib.h> | #import <IOKit/IOKitLib.h> | ||||
| @@ -310,7 +310,7 @@ void MessageManager::runDispatchLoop() | |||||
| { | { | ||||
| // An AppKit exception will kill the app, but at least this provides a chance to log it., | // An AppKit exception will kill the app, but at least this provides a chance to log it., | ||||
| std::runtime_error ex (std::string ("NSException: ") + [[e name] UTF8String] + ", Reason:" + [[e reason] UTF8String]); | std::runtime_error ex (std::string ("NSException: ") + [[e name] UTF8String] + ", Reason:" + [[e reason] UTF8String]); | ||||
| JUCEApplicationBase::sendUnhandledException (&ex, __FILE__, __LINE__); | |||||
| JUCEApplication::sendUnhandledException (&ex, __FILE__, __LINE__); | |||||
| } | } | ||||
| @finally | @finally | ||||
| { | { | ||||