From a7c14e2f29831f4bc5eb18e23e55eb6f7a4e3431 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 8 Apr 2024 17:12:12 +0200 Subject: Merging upstream version 115.8.0esr. Signed-off-by: Daniel Baumann --- toolkit/crashreporter/nsExceptionHandler.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'toolkit/crashreporter/nsExceptionHandler.cpp') diff --git a/toolkit/crashreporter/nsExceptionHandler.cpp b/toolkit/crashreporter/nsExceptionHandler.cpp index aca9248147..534f5ab48c 100644 --- a/toolkit/crashreporter/nsExceptionHandler.cpp +++ b/toolkit/crashreporter/nsExceptionHandler.cpp @@ -1532,21 +1532,20 @@ bool MinidumpCallback( WriteAnnotationsForMainProcessCrash(apiData, addrInfo, crashTime); } - if (!doReport) { -#ifdef XP_WIN - TerminateProcess(GetCurrentProcess(), 1); -#endif // XP_WIN - return returnValue; - } - + if (doReport && isSafeToDump) { + // We launch the crash reporter client/dialog only if we've been explicitly + // asked to report crashes and if we weren't already trying to unset the + // exception handler (which is indicated by isSafeToDump being false). #if defined(MOZ_WIDGET_ANDROID) // Android - returnValue = - LaunchCrashHandlerService(crashReporterPath.c_str(), minidumpPath); + returnValue = + LaunchCrashHandlerService(crashReporterPath.c_str(), minidumpPath); #else // Windows, Mac, Linux, etc... - returnValue = LaunchProgram(crashReporterPath.c_str(), minidumpPath); -# ifdef XP_WIN + returnValue = LaunchProgram(crashReporterPath.c_str(), minidumpPath); +#endif + } + +#ifdef XP_WIN TerminateProcess(GetCurrentProcess(), 1); -# endif #endif return returnValue; -- cgit v1.2.3