From 655324f9dab084d47263f7510288ee3938d7f2e4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 2 Aug 2013 19:08:33 +0000 Subject: /debug command line option to disable built-in exception handlers git-svn-id: http://svn.miranda-ng.org/main/trunk@5553 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_core/threads.cpp | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) (limited to 'src/mir_core/threads.cpp') diff --git a/src/mir_core/threads.cpp b/src/mir_core/threads.cpp index ddce70df8b..af61aa82f9 100644 --- a/src/mir_core/threads.cpp +++ b/src/mir_core/threads.cpp @@ -110,12 +110,16 @@ void __cdecl forkthread_r(void *arg) void *cookie = fa->arg; Thread_Push((HINSTANCE)callercode); SetEvent(fa->hEvent); - __try - { + if (g_bDebugMode) callercode(cookie); - } - __except(pMirandaExceptFilter(GetExceptionCode(), GetExceptionInformation())) - { + else { + __try + { + callercode(cookie); + } + __except(pMirandaExceptFilter(GetExceptionCode(), GetExceptionInformation())) + { + } } SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); @@ -150,15 +154,23 @@ unsigned __stdcall forkthreadex_r(void * arg) Thread_Push((HINSTANCE)threadcode, fa->owner); SetEvent(fa->hEvent); - __try - { + if (g_bDebugMode) { if (owner) rc = threadcodeex(owner, cookie); else rc = threadcode(cookie); } - __except(pMirandaExceptFilter(GetExceptionCode(), GetExceptionInformation())) - { + else { + __try + { + if (owner) + rc = threadcodeex(owner, cookie); + else + rc = threadcode(cookie); + } + __except(pMirandaExceptFilter(GetExceptionCode(), GetExceptionInformation())) + { + } } SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL); -- cgit v1.2.3