diff options
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/ole/unoobjw.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx index 2ee61fd34ec2..9c70af4ad9c5 100644 --- a/extensions/source/ole/unoobjw.cxx +++ b/extensions/source/ole/unoobjw.cxx @@ -119,6 +119,7 @@ class TerminationVetoer : public WeakImplHelper<css::frame::XTerminateListener> public: int mnCount; +private: TerminationVetoer() : mnCount(0) { @@ -134,6 +135,15 @@ public: } } +public: + static Reference< TerminationVetoer > get() + { + static TerminationVetoer* pInstance = new TerminationVetoer; + static Reference< TerminationVetoer > aInstance( pInstance ); + + return aInstance; + } + // XTerminateListener void SAL_CALL queryTermination( const EventObject& ) override { @@ -156,8 +166,6 @@ public: } }; -static TerminationVetoer aTerminationVetoer; - /* Does not throw any exceptions. Param pInfo can be NULL. */ @@ -176,7 +184,7 @@ InterfaceOleWrapper::InterfaceOleWrapper( Reference<XMultiServiceFactory> const UnoConversionUtilities<InterfaceOleWrapper>( xFactory, unoWrapperClass, comWrapperClass), m_defaultValueType( 0) { - aTerminationVetoer.mnCount++; + TerminationVetoer::get()->mnCount++; } InterfaceOleWrapper::~InterfaceOleWrapper() @@ -187,7 +195,7 @@ InterfaceOleWrapper::~InterfaceOleWrapper() if(it != UnoObjToWrapperMap.end()) UnoObjToWrapperMap.erase(it); - aTerminationVetoer.mnCount--; + TerminationVetoer::get()->mnCount--; } STDMETHODIMP InterfaceOleWrapper::QueryInterface(REFIID riid, LPVOID FAR * ppv) |