diff options
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/services/autorecovery.cxx | 26 | ||||
-rw-r--r-- | framework/util/fwk.component | 3 |
2 files changed, 7 insertions, 22 deletions
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index bdc46b1d73d4..085b627f5794 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -4219,25 +4219,6 @@ void AutoRecovery::st_impl_removeLockFile() } } -struct Instance { - explicit Instance( - css::uno::Reference<css::uno::XComponentContext> const & context): - instance( - static_cast<cppu::OWeakObject *>(new AutoRecovery(context))) - { - // 2nd phase initialization needed - static_cast<AutoRecovery*>(static_cast<cppu::OWeakObject *> - (instance.get()))->initListeners(); - } - - css::uno::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 * @@ -4245,8 +4226,11 @@ com_sun_star_comp_framework_AutoRecovery_get_implementation( css::uno::XComponentContext *context, css::uno::Sequence<css::uno::Any> const &) { - return cppu::acquire(static_cast<cppu::OWeakObject *>( - Singleton::get(context).instance.get())); + rtl::Reference<AutoRecovery> xAutoRecovery = new AutoRecovery(context); + // 2nd phase initialization needed + xAutoRecovery->initListeners(); + + return cppu::acquire(xAutoRecovery.get()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/framework/util/fwk.component b/framework/util/fwk.component index cc5fcfb13faa..aad750e76c72 100644 --- a/framework/util/fwk.component +++ b/framework/util/fwk.component @@ -28,7 +28,8 @@ <service name="com.sun.star.ui.ToolBarFactory"/> </implementation> <implementation name="com.sun.star.comp.framework.AutoRecovery" - constructor="com_sun_star_comp_framework_AutoRecovery_get_implementation"> + constructor="com_sun_star_comp_framework_AutoRecovery_get_implementation" + single-instance="true"> <service name="com.sun.star.frame.AutoRecovery"/> <singleton name="com.sun.star.frame.theAutoRecovery"/> </implementation> |