summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2017-12-15 14:22:10 +0000
committerpranavk <pranavk@collabora.co.uk>2017-12-15 21:06:07 +0100
commitd93718ff92e485ebcd014713574be596b8815ff8 (patch)
treedf5f5d135e3fb721a59c2ae8ce3b949d8f715ccc /sfx2
parentcf54640727c9b58856e9abf15c0ac82d876262b6 (diff)
Handle resmgr lifecycle with vcl's de-init more cleanly.
Change-Id: Iee5f54edc09d0df7062ffdcb301876fcec791373 Reviewed-on: https://gerrit.libreoffice.org/46562 Reviewed-by: pranavk <pranavk@collabora.co.uk> Tested-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/bastyp/sfxresid.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sfx2/source/bastyp/sfxresid.cxx b/sfx2/source/bastyp/sfxresid.cxx
index 40f02c4c3caa..a90d67adee41 100644
--- a/sfx2/source/bastyp/sfxresid.cxx
+++ b/sfx2/source/bastyp/sfxresid.cxx
@@ -21,8 +21,9 @@
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
#include <tools/resmgr.hxx>
+#include <vcl/lazydelete.hxx>
-static std::unique_ptr<ResMgr> pMgr;
+static vcl::DeleteOnDeinit<ResMgr> pMgr(nullptr);
SfxResId::SfxResId( sal_uInt16 nId ) :
ResId( nId, *GetResMgr() )
@@ -33,7 +34,7 @@ ResMgr* SfxResId::GetResMgr()
{
const LanguageTag& rLocale = Application::GetSettings().GetUILanguageTag();
- if (!pMgr || pMgr->GetLocale() != rLocale)
+ if (!pMgr.get() || pMgr.get()->GetLocale() != rLocale)
pMgr.reset(ResMgr::CreateResMgr("sfx", rLocale));
return pMgr.get();