include/svl/inethist.hxx | 6 ------ svl/source/misc/inethist.cxx | 17 ++--------------- 2 files changed, 2 insertions(+), 21 deletions(-)
New commits: commit e9e57a3dbd8b780e0ae3c9015d757719b893f190 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Tue Dec 17 09:14:23 2019 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Tue Dec 17 10:15:03 2019 +0100 Elide use of rtl_Instance (which is obsoleted by C++11 thread-safe statics) Change-Id: Ic7b78dffb2f8d1908f3263d88c5912aec2ebce8b Reviewed-on: https://gerrit.libreoffice.org/85263 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/include/svl/inethist.hxx b/include/svl/inethist.hxx index eef642a2b770..21f7b6e2f940 100644 --- a/include/svl/inethist.hxx +++ b/include/svl/inethist.hxx @@ -28,12 +28,6 @@ class INetURLHistory_Impl; class SVL_DLLPUBLIC INetURLHistory final : public SfxBroadcaster { - struct SAL_DLLPRIVATE StaticInstance - { - INetURLHistory * operator()(); - }; - friend INetURLHistory * StaticInstance::operator()(); - /** Representation. */ std::unique_ptr<INetURLHistory_Impl> m_pImpl; diff --git a/svl/source/misc/inethist.cxx b/svl/source/misc/inethist.cxx index 19cae51df5ad..59f54ee80268 100644 --- a/svl/source/misc/inethist.cxx +++ b/svl/source/misc/inethist.cxx @@ -22,9 +22,7 @@ #include <algorithm> #include <string.h> -#include <rtl/instance.hxx> #include <rtl/crc.h> -#include <osl/getglobalmutex.hxx> #include <tools/debug.hxx> #include <tools/urlobj.hxx> @@ -273,15 +271,6 @@ bool INetURLHistory_Impl::queryUrl (const OUString &rUrl) const return (k < capacity()) && (m_pHash[k] == h); } -/* - * INetURLHistory::StaticInstance implementation. - */ -INetURLHistory * INetURLHistory::StaticInstance::operator ()() -{ - static INetURLHistory g_aInstance; - return &g_aInstance; -} - INetURLHistory::INetURLHistory() : m_pImpl (new INetURLHistory_Impl()) { } @@ -295,10 +284,8 @@ INetURLHistory::~INetURLHistory() */ INetURLHistory* INetURLHistory::GetOrCreate() { - return rtl_Instance< - INetURLHistory, StaticInstance, - osl::MutexGuard, osl::GetGlobalMutex >::create ( - StaticInstance(), osl::GetGlobalMutex()); + static INetURLHistory instance; + return &instance; } void INetURLHistory::NormalizeUrl_Impl (INetURLObject &rUrl) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits