From 26c44023a04b00e737e82119a0f161f7b272439d Mon Sep 17 00:00:00 2001 From: "vladimir%pobox.com" Date: Mon, 12 Dec 2005 19:09:58 +0000 Subject: [PATCH] b=317351, add env var to disable windows crash dialog on crash, r=bsmedberg --- toolkit/xre/nsAppRunner.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp index 811b125220aa..d0107deb60c1 100644 --- a/toolkit/xre/nsAppRunner.cpp +++ b/toolkit/xre/nsAppRunner.cpp @@ -1842,7 +1842,16 @@ XRE_main(int argc, char* argv[], const nsXREAppData* aAppData) // Suppress the "DLL Foo could not be found" dialog, such that if dependent // libraries (such as GDI+) are not preset, we gracefully fail to load those // XPCOM components, instead of being ungraceful. - SetErrorMode(SEM_FAILCRITICALERRORS); + UINT realMode = SetErrorMode(0); + realMode |= SEM_FAILCRITICALERRORS; + // If XRE_NO_WINDOWS_CRASH_DIALOG is set, suppress displaying the "This + // application has crashed" dialog box. This is mainly useful for + // automated testing environments, e.g. tinderbox, where there's no need + // for a dozen of the dialog boxes to litter the console + if (getenv("XRE_NO_WINDOWS_CRASH_DIALOG")) + realMode |= SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX; + + SetErrorMode(realMode); #ifdef DEBUG // Disable small heap allocator to get heapwalk() giving us