diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-03-22 13:33:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-03-23 07:40:23 +0100 |
commit | e657ec8449d306e9c04801e9db3552b96a8a8dd9 (patch) | |
tree | fbf9d516b365293298db50afb0fe912e261df7d8 /comphelper/source | |
parent | 9a1f9c13439491d3b78a73f6eee5cda4e561401f (diff) |
use single-use attribute for OOfficeRestartManager
instead of rtl::Instance, which means it will get
cleaned up when UNO shuts down
Change-Id: I71d8bd457687537e620a420c3cbf633f7a0b3f97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112927
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper/source')
-rw-r--r-- | comphelper/source/misc/officerestartmanager.cxx | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/comphelper/source/misc/officerestartmanager.cxx b/comphelper/source/misc/officerestartmanager.cxx index f56486858522..ad6e308d2819 100644 --- a/comphelper/source/misc/officerestartmanager.cxx +++ b/comphelper/source/misc/officerestartmanager.cxx @@ -146,31 +146,13 @@ uno::Sequence< OUString > SAL_CALL OOfficeRestartManager::getSupportedServiceNam } // namespace comphelper -namespace { - -struct Instance { - explicit Instance( - css::uno::Reference<css::uno::XComponentContext> const & context): - instance(static_cast<cppu::OWeakObject *>(new comphelper::OOfficeRestartManager(context))) - {} - - rtl::Reference<css::uno::XInterface> instance; -}; - -struct Singleton: - public rtl::StaticWithArg< - Instance, css::uno::Reference<css::uno::XComponentContext>, Singleton> -{}; - -} extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_task_OfficeRestartManager( css::uno::XComponentContext *context, css::uno::Sequence<css::uno::Any> const &) { - return cppu::acquire(static_cast<cppu::OWeakObject *>( - Singleton::get(context).instance.get())); + return cppu::acquire(new comphelper::OOfficeRestartManager(context)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |