mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 07:56:14 +01:00
gwin32: Do not register a crash handler unless requested
Fixes https://gitlab.gnome.org/GNOME/glib/issues/2025
This commit is contained in:
parent
6919a719c1
commit
0cfbe8f3b0
@ -1208,6 +1208,14 @@ g_crash_handler_win32_init (void)
|
||||
if (WinVEH_handle != NULL)
|
||||
return;
|
||||
|
||||
/* Do not register an exception handler if we're not supposed to catch any
|
||||
* exceptions. Exception handlers are considered dangerous to use, and can
|
||||
* break advanced exception handling such as in CLRs like C# or other managed
|
||||
* code. See: https://blogs.msdn.microsoft.com/jmstall/2006/05/24/beware-of-the-vectored-exception-handler-and-managed-code/
|
||||
*/
|
||||
if (getenv ("G_DEBUGGER") == NULL && getenv("G_VEH_CATCH") == NULL)
|
||||
return;
|
||||
|
||||
WinVEH_handle = AddVectoredExceptionHandler (0, &g_win32_veh_handler);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user