Remove BEAST_CATCH_UNHANDLED_EXCEPTIONS

This commit is contained in:
Vinnie Falco
2013-09-09 13:34:18 -07:00
parent d8ea4f9b06
commit 4676db126a
6 changed files with 15 additions and 59 deletions

View File

@@ -54,14 +54,6 @@
//#define BEAST_LOG_ASSERTIONS 1
#endif
/** Config: BEAST_CATCH_UNHANDLED_EXCEPTIONS
This will wrap certain operating system calls with exception catching
code that converts the system exception into a regular error.
*/
#ifndef BEAST_CATCH_UNHANDLED_EXCEPTIONS
//#define BEAST_CATCH_UNHANDLED_EXCEPTIONS 0
#endif
/** Config: BEAST_CHECK_MEMORY_LEAKS
Enables a memory-leak check for certain objects when the app terminates.
See the LeakChecked class for more details about enabling leak checking for

View File

@@ -860,12 +860,8 @@ bool Process::openDocument (const String& fileName, const String& parameters)
{
HINSTANCE hInstance = 0;
BEAST_TRY
{
hInstance = ShellExecute (0, 0, fileName.toWideCharPointer(),
parameters.toWideCharPointer(), 0, SW_SHOWDEFAULT);
}
BEAST_CATCH_ALL
hInstance = ShellExecute (0, 0, fileName.toWideCharPointer(),
parameters.toWideCharPointer(), 0, SW_SHOWDEFAULT);
return hInstance > (HINSTANCE) 32;
}

View File

@@ -335,26 +335,18 @@ bool DynamicLibrary::open (const String& name)
{
close();
BEAST_TRY
{
handle = LoadLibrary (name.toWideCharPointer());
}
BEAST_CATCH_ALL
handle = LoadLibrary (name.toWideCharPointer());
return handle != nullptr;
}
void DynamicLibrary::close()
{
BEAST_TRY
if (handle != nullptr)
{
if (handle != nullptr)
{
FreeLibrary ((HMODULE) handle);
handle = nullptr;
}
FreeLibrary ((HMODULE) handle);
handle = nullptr;
}
BEAST_CATCH_ALL
}
void* DynamicLibrary::getFunction (const String& functionName) noexcept

View File

@@ -172,22 +172,6 @@ template <> struct BeastStaticAssert <true> { static void dummy() {} };
//------------------------------------------------------------------------------
#if BEAST_CATCH_UNHANDLED_EXCEPTIONS
# define BEAST_TRY try
# define BEAST_CATCH_ALL catch (...) {}
# define BEAST_CATCH_ALL_ASSERT catch (...) { bassertfalse; }
# define BEAST_CATCH_EXCEPTION BEAST_CATCH_ALL
#else
# define BEAST_TRY
# define BEAST_CATCH_EXCEPTION
# define BEAST_CATCH_ALL
# define BEAST_CATCH_ALL_ASSERT
#endif
//------------------------------------------------------------------------------
#if BEAST_DEBUG || DOXYGEN
/** A platform-independent way of forcing an inline function.
Use the syntax: @code

View File

@@ -79,22 +79,18 @@ void Thread::threadEntryPoint()
const CurrentThreadHolder::Ptr currentThreadHolder (getCurrentThreadHolder());
currentThreadHolder->value = this;
BEAST_TRY
if (threadName.isNotEmpty())
setCurrentThreadName (threadName);
if (startSuspensionEvent.wait (10000))
{
if (threadName.isNotEmpty())
setCurrentThreadName (threadName);
bassert (getCurrentThreadId() == threadId);
if (startSuspensionEvent.wait (10000))
{
bassert (getCurrentThreadId() == threadId);
if (affinityMask != 0)
setCurrentThreadAffinityMask (affinityMask);
if (affinityMask != 0)
setCurrentThreadAffinityMask (affinityMask);
run();
}
run();
}
BEAST_CATCH_ALL_ASSERT
currentThreadHolder->value.releaseCurrentThreadStorage();
closeThreadHandle();

View File

@@ -332,11 +332,7 @@ bool ThreadPool::runNextJob()
ThreadPoolJob::JobStatus result = ThreadPoolJob::jobHasFinished;
BEAST_TRY
{
result = job->runJob();
}
BEAST_CATCH_ALL_ASSERT
result = job->runJob();
OwnedArray<ThreadPoolJob> deletionList;