diff options
-rw-r--r-- | desktop/source/app/app.cxx | 2 | ||||
-rw-r--r-- | desktop/source/app/crashreport.cxx | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index c9dbcca1b290..202285287a78 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2010,7 +2010,7 @@ void Desktop::OpenClients() #endif #if HAVE_FEATURE_BREAKPAD - if (CrashReporter::crashReportInfoExists()) + if (CrashReporter::IsDumpEnable() && CrashReporter::crashReportInfoExists()) handleCrashReport(); #endif diff --git a/desktop/source/app/crashreport.cxx b/desktop/source/app/crashreport.cxx index 379dfa38defd..c90a584a4163 100644 --- a/desktop/source/app/crashreport.cxx +++ b/desktop/source/app/crashreport.cxx @@ -231,15 +231,21 @@ void CrashReporter::removeExceptionHandler() bool CrashReporter::IsDumpEnable() { + static bool bConfigRead = false; + static bool bEnable = true; // default, always on + + if (bConfigRead) + return bEnable; + OUString sToken; OString sEnvVar(std::getenv("CRASH_DUMP_ENABLE")); - bool bEnable = true; // default, always on // read configuration item 'CrashDumpEnable' -> bool on/off if (rtl::Bootstrap::get("CrashDumpEnable", sToken) && sEnvVar.isEmpty()) { bEnable = sToken.toBoolean(); } + bConfigRead = true; return bEnable; } |