framework/source/uifactory/uicontrollerfactory.cxx | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
New commits: commit aed4c42491b294cb57efc950a4d0209116be6452 Author: Noel Grandin <n...@peralex.com> Date: Wed Jun 8 08:55:36 2016 +0200 remove some manual ref-counting in framework Change-Id: I469439abfa4e9dcd29f2d1693b03d37b3d61c81e Reviewed-on: https://gerrit.libreoffice.org/26047 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noelgran...@gmail.com> diff --git a/framework/source/uifactory/uicontrollerfactory.cxx b/framework/source/uifactory/uicontrollerfactory.cxx index e62c171..7d4809b 100644 --- a/framework/source/uifactory/uicontrollerfactory.cxx +++ b/framework/source/uifactory/uicontrollerfactory.cxx @@ -25,6 +25,7 @@ #include <com/sun/star/frame/XUIControllerFactory.hpp> #include <rtl/ustrbuf.hxx> +#include <rtl/ref.hxx> #include <cppuhelper/basemutex.hxx> #include <cppuhelper/compbase.hxx> #include <cppuhelper/supportsservice.hxx> @@ -60,9 +61,9 @@ public: protected: UIControllerFactory( const css::uno::Reference< css::uno::XComponentContext >& xContext, const rtl::OUString &rUINode ); - bool m_bConfigRead; - css::uno::Reference< css::uno::XComponentContext > m_xContext; - ConfigurationAccess_ControllerFactory* m_pConfigAccess; + bool m_bConfigRead; + css::uno::Reference< css::uno::XComponentContext > m_xContext; + rtl::Reference<ConfigurationAccess_ControllerFactory> m_pConfigAccess; private: virtual void SAL_CALL disposing() override; @@ -78,7 +79,6 @@ UIControllerFactory::UIControllerFactory( { m_pConfigAccess = new ConfigurationAccess_ControllerFactory(m_xContext, "/org.openoffice.Office.UI.Controller/Registered/" + rConfigurationNode); - m_pConfigAccess->acquire(); } UIControllerFactory::~UIControllerFactory() @@ -89,12 +89,7 @@ UIControllerFactory::~UIControllerFactory() void SAL_CALL UIControllerFactory::disposing() { osl::MutexGuard g(rBHelper.rMutex); - if (m_pConfigAccess) - { - // reduce reference count - m_pConfigAccess->release(); - m_pConfigAccess = nullptr; - } + m_pConfigAccess.clear(); } // XMultiComponentFactory _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits