svl/source/numbers/numuno.cxx | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
New commits: commit f405c6a670a4272581095b4aa75bb0ca8c6daf63 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Apr 4 19:23:40 2025 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Apr 4 21:37:49 2025 +0200 Revert "reduce object creation in SvNumberFormatsSupplierObj (tdf#147874 related)" This reverts commit 083556bd17713bbbb1e7569b738c87dc3e93edf9. Reason for revert: This created a reference cycle, leading to a memory leak Change-Id: I786ff3674d88bf41d451f656914729ae4d53bf9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183725 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/svl/source/numbers/numuno.cxx b/svl/source/numbers/numuno.cxx index 7deea0dfca6b..db633f40554e 100644 --- a/svl/source/numbers/numuno.cxx +++ b/svl/source/numbers/numuno.cxx @@ -29,7 +29,6 @@ class SvNumFmtSuppl_Impl public: SvNumberFormatter* pFormatter; mutable ::comphelper::SharedMutex aMutex; - rtl::Reference<SvNumberFormatsObj> mxNumberFormatsObj; explicit SvNumFmtSuppl_Impl(SvNumberFormatter* p) : pFormatter(p) {} @@ -65,7 +64,6 @@ void SvNumberFormatsSupplierObj::SetNumberFormatter(SvNumberFormatter* pNew) { // The old Numberformatter has been retired, do not access it anymore! pImpl->pFormatter = pNew; - pImpl->mxNumberFormatsObj.clear(); } // XNumberFormatsSupplier @@ -81,10 +79,7 @@ uno::Reference<util::XNumberFormats> SAL_CALL SvNumberFormatsSupplierObj::getNum { ::osl::MutexGuard aGuard( pImpl->aMutex ); - if (!pImpl->mxNumberFormatsObj) - pImpl->mxNumberFormatsObj = new SvNumberFormatsObj( *this, pImpl->aMutex ); - - return pImpl->mxNumberFormatsObj; + return new SvNumberFormatsObj( *this, pImpl->aMutex ); } // XUnoTunnel