summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-12-02 14:21:46 +0000
committerAndras Timar <andras.timar@collabora.com>2017-02-08 11:56:05 +0100
commit32714aacbaa720ed3bcdd6f04c2f910d4096a0e5 (patch)
tree22ff04069149702d41b5bc008b17981bf819d29c /sfx2
parent1c91cde89e4be6d7ee45e225cfb4335076777049 (diff)
usageinfo causes one of our more frequent fedora 25 crashes
https://retrace.fedoraproject.org/faf/problems/bthash/?bth=17ba9a57f40d5ca29778866a9f96c1c0dfc7593c&bth=2f1801e44e9cb0be2b013624521fb0959dc2c73a&bth=5e8a1e07503f53b13b3a6779084f8b0637aaf5a7&bth=8033013a2ce586bccc23245583fa86ef4a761dce&bth=975271167132418534cb07336601efb5b0c711f0&bth=de75c2ad7917bc889d6307b152f79d34e79ce74d Change-Id: Ie93afa476eca9fdbf7ea17ff0189fbaa493a5531 (cherry picked from commit a064f1226b9864f0d0ef6d969f2ae53cc413eb51) Reviewed-on: https://gerrit.libreoffice.org/31554 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit a2e1f2749ee446e3be87e6bb8eacc26376f1f34b)
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/control/unoctitm.cxx12
1 files changed, 10 insertions, 2 deletions
diff --git a/sfx2/source/control/unoctitm.cxx b/sfx2/source/control/unoctitm.cxx
index 2e4d18facbe9..0adbfd2ee3d7 100644
--- a/sfx2/source/control/unoctitm.cxx
+++ b/sfx2/source/control/unoctitm.cxx
@@ -613,6 +613,9 @@ class UsageInfo {
/// Command vs. how many times it was used
UsageMap maUsage;
+ /// config path, get it long before atexit time
+ OUString msConfigPath;
+
public:
UsageInfo() : mbIsCollecting(false)
{
@@ -630,7 +633,12 @@ public:
void save();
/// Modify the flag whether we are collecting.
- void setCollecting(bool bIsCollecting) { mbIsCollecting = bIsCollecting; }
+ void setCollecting(bool bIsCollecting)
+ {
+ mbIsCollecting = bIsCollecting;
+ if (mbIsCollecting)
+ msConfigPath = SvtPathOptions().GetConfigPath();
+ }
};
void UsageInfo::increment(const OUString &rCommand)
@@ -648,7 +656,7 @@ void UsageInfo::save()
if (!mbIsCollecting)
return;
- OUString path(SvtPathOptions().GetConfigPath());
+ OUString path(msConfigPath);
path += "usage/";
osl::Directory::createPath(path);