b=317351, add env var to disable windows crash dialog on crash, r=bsmedberg

This commit is contained in:
vladimir%pobox.com 2005-12-12 19:09:58 +00:00
Родитель bb4a65a81b
Коммит 26c44023a0
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -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