diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2023-03-23 11:11:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-23 19:49:25 +0000 |
commit | e7dbef922a2fc73469f12c520bcc1af54fe038fb (patch) | |
tree | 02c18e1d1c9d0d85914626f66ace24a79f892e79 /sal/osl | |
parent | 462ebbd10bd537f42104fe991a0aeebcd563f178 (diff) |
rtl::Static to thread-safe-static
Change-Id: Ife02e6d2be3ebfbb08522ab0183ef4aa31a99e19
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149415
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/osl')
-rw-r--r-- | sal/osl/all/debugbase.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sal/osl/all/debugbase.cxx b/sal/osl/all/debugbase.cxx index 59848a883c9d..b4b598589a00 100644 --- a/sal/osl/all/debugbase.cxx +++ b/sal/osl/all/debugbase.cxx @@ -30,9 +30,10 @@ namespace { -struct StaticDebugBaseAddressFilter - : rtl::StaticWithInit<std::vector<OString>, StaticDebugBaseAddressFilter> { - std::vector<OString> operator()() const { +const std::vector<OString>& StaticDebugBaseAddressFilter() +{ + static const std::vector<OString> theFilter = []() + { std::vector<OString> vec; rtl_uString * pStr = nullptr; OUString const name( @@ -49,7 +50,8 @@ struct StaticDebugBaseAddressFilter while (nIndex >= 0); } return vec; - } + }(); + return theFilter; }; bool isSubStr( char const* pStr, OString const& subStr ) @@ -81,7 +83,7 @@ osl::Mutex & SAL_CALL osl_detail_ObjectRegistry_getMutex() bool SAL_CALL osl_detail_ObjectRegistry_storeAddresses( char const* pName ) SAL_THROW_EXTERN_C() { - std::vector<OString> const& rVec = StaticDebugBaseAddressFilter::get(); + std::vector<OString> const& rVec = StaticDebugBaseAddressFilter(); if (rVec.empty()) return false; // check for "all": |