diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-05-06 16:33:55 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-05-06 16:33:55 +0200 |
commit | db06595d13ab00c1c7584456b4bcd85797eadaa9 (patch) | |
tree | 67d2e86b570bbc01c7019fe39893fc2ffa2c5e5e /framework | |
parent | 36e22e83a1ca3106d6ef3fbb6ba066a447a65601 (diff) |
vcl::EventPoster shall probably be covered by SolarMutex
...as most parts of VCL. Ran across at least one case where a remote call to
framework::CloseDispatcher::release -> ~CloseDispatcher -> ~EventPoster ->
Application::RemoveUserEvent caused a crash. As always with SolarMutex, keep
fingers crossed that this is about the right level to acquire it.
Change-Id: I8f4be7329adbf72355774fa5d3c472270da3ddd2
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/dispatch/closedispatcher.hxx | 3 | ||||
-rw-r--r-- | framework/source/dispatch/closedispatcher.cxx | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/framework/inc/dispatch/closedispatcher.hxx b/framework/inc/dispatch/closedispatcher.hxx index 3c017547a83d..db5f7c3c6dfe 100644 --- a/framework/inc/dispatch/closedispatcher.hxx +++ b/framework/inc/dispatch/closedispatcher.hxx @@ -36,6 +36,7 @@ #include <com/sun/star/uno/XComponentContext.hpp> #include <com/sun/star/frame/DispatchResultState.hpp> +#include <boost/scoped_ptr.hpp> #include <cppuhelper/implbase2.hxx> #include <vcl/evntpost.hxx> @@ -88,7 +89,7 @@ class CloseDispatcher : public ::cppu::WeakImplHelper2< /** @short used for asynchronous callbacks within the main thread. @descr Internally we work asynchronous. Because our callis are not aware, that her request can kill its own environment ... */ - ::vcl::EventPoster m_aAsyncCallback; + boost::scoped_ptr<vcl::EventPoster> m_aAsyncCallback; /** @short used inside asyncronous callback to decide, which operation must be executed. */ diff --git a/framework/source/dispatch/closedispatcher.cxx b/framework/source/dispatch/closedispatcher.cxx index afef22b867c3..f511d002949a 100644 --- a/framework/source/dispatch/closedispatcher.cxx +++ b/framework/source/dispatch/closedispatcher.cxx @@ -57,7 +57,8 @@ CloseDispatcher::CloseDispatcher(const css::uno::Reference< css::uno::XComponent const css::uno::Reference< css::frame::XFrame >& xFrame , const OUString& sTarget) : m_xContext (rxContext ) - , m_aAsyncCallback (LINK( this, CloseDispatcher, impl_asyncCallback)) + , m_aAsyncCallback( + new vcl::EventPoster(LINK(this, CloseDispatcher, impl_asyncCallback))) , m_eOperation(E_CLOSE_DOC) , m_lStatusListener(m_mutex) , m_pSysWindow(NULL) @@ -77,6 +78,8 @@ CloseDispatcher::CloseDispatcher(const css::uno::Reference< css::uno::XComponent CloseDispatcher::~CloseDispatcher() { + SolarMutexGuard g; + m_aAsyncCallback.reset(); } void SAL_CALL CloseDispatcher::dispatch(const css::util::URL& aURL , @@ -215,7 +218,10 @@ void SAL_CALL CloseDispatcher::dispatchWithNotification(const css::util::URL& if ( bIsSynchron ) impl_asyncCallback(0); else - m_aAsyncCallback.Post(0); + { + SolarMutexGuard g; + m_aAsyncCallback->Post(0); + } } /** |