__mingw_SEH_error_handler (either directly or via _gnu_exception_handler)
is already registered via SEH at application entry point. So there is no
need to register _gnu_exception_handler second time via Windows
UnhandledExceptionFilter API.
---
 mingw-w64-crt/crt/crt_handler.c | 4 ----
 mingw-w64-crt/crt/crtexe.c      | 3 ---
 2 files changed, 7 deletions(-)

diff --git a/mingw-w64-crt/crt/crt_handler.c b/mingw-w64-crt/crt/crt_handler.c
index 647087f996e3..e57d22ccb24c 100644
--- a/mingw-w64-crt/crt/crt_handler.c
+++ b/mingw-w64-crt/crt/crt_handler.c
@@ -179,8 +179,6 @@ __mingw_SEH_error_handler (struct _EXCEPTION_RECORD* 
ExceptionRecord,
   return action;
 }
 
-LPTOP_LEVEL_EXCEPTION_FILTER __mingw_oldexcpt_handler = NULL;
-
 long CALLBACK
 _gnu_exception_handler (EXCEPTION_POINTERS *exception_data);
 
@@ -278,7 +276,5 @@ _gnu_exception_handler (EXCEPTION_POINTERS *exception_data)
       break;
     }
 
-  if (action == EXCEPTION_CONTINUE_SEARCH && __mingw_oldexcpt_handler)
-    action = (*__mingw_oldexcpt_handler)(exception_data);
   return action;
 }
diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c
index dc6e656cb6fa..90304061ca78 100644
--- a/mingw-w64-crt/crt/crtexe.c
+++ b/mingw-w64-crt/crt/crtexe.c
@@ -51,10 +51,8 @@ static _TCHAR **envp;
 
 static int managedapp;
 static int has_cctor = 0;
-extern LPTOP_LEVEL_EXCEPTION_FILTER __mingw_oldexcpt_handler;
 
 extern void _pei386_runtime_relocator (void);
-long CALLBACK _gnu_exception_handler (EXCEPTION_POINTERS * exception_data);
 EXCEPTION_DISPOSITION __cdecl __mingw_SEH_error_handler (struct 
_EXCEPTION_RECORD *, void *, struct _CONTEXT *, void *);
 static int duplicate_ppstrings (int ac, _TCHAR ***av);
 
@@ -203,7 +201,6 @@ __tmainCRTStartup (void)
 #if defined(__x86_64__) && !defined(__SEH__)
        __mingw_init_ehandler ();
 #endif
-       __mingw_oldexcpt_handler = SetUnhandledExceptionFilter 
(_gnu_exception_handler);
        _set_invalid_parameter_handler (__mingw_invalidParameterHandler);
        _fpreset ();
 
-- 
2.20.1



_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to