summaryrefslogtreecommitdiff
path: root/framework/source/services/desktop.cxx
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2010-11-22 09:28:34 +0100
committerDavid Tardon <dtardon@redhat.com>2010-11-22 09:50:48 +0100
commitf1d2af0d86548e0c916eeadc934d4d1131eaecc2 (patch)
treee54264077131ad158e6c8502d47816f80b3fa13f /framework/source/services/desktop.cxx
parent266310d47870bd72f2fa52d7e888bbcb5290174b (diff)
rhbz#650170# shutdown quickstarter at end of desktop session
Diffstat (limited to 'framework/source/services/desktop.cxx')
-rw-r--r--framework/source/services/desktop.cxx35
1 files changed, 35 insertions, 0 deletions
diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx
index 1c862faf36bf..216c7a94624c 100644
--- a/framework/source/services/desktop.cxx
+++ b/framework/source/services/desktop.cxx
@@ -83,6 +83,7 @@
//_________________________________________________________________________________________________________________
// includes of other projects
//_________________________________________________________________________________________________________________
+#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/queryinterface.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <cppuhelper/factory.hxx>
@@ -264,6 +265,7 @@ Desktop::Desktop( const css::uno::Reference< css::lang::XMultiServiceFactory >&
, m_xSWThreadManager ( )
, m_xSfxTerminator ( )
, m_xTitleNumberGenerator ( )
+ , m_bTerminating(false)
{
// Safe impossible cases
// We don't accept all incoming parameter.
@@ -291,6 +293,39 @@ Desktop::~Desktop()
sal_Bool SAL_CALL Desktop::terminate()
throw( css::uno::RuntimeException )
{
+ bool bTerminating(false);
+ {
+ WriteGuard aGuard(m_aLock);
+ bTerminating = m_bTerminating;
+ m_bTerminating = true;
+ }
+ if (bTerminating)
+ return false;
+
+ css::uno::Any aException;
+ sal_Bool bTerminate(false);
+ try
+ {
+ bTerminate = impl_terminate();
+ }
+ catch (const css::uno::RuntimeException& rEx)
+ {
+ aException <<= rEx;
+ }
+
+ {
+ WriteGuard aGuard(m_aLock);
+ m_bTerminating = false;
+ }
+
+ if (aException.hasValue())
+ cppu::throwException(aException);
+
+ return bTerminate;
+}
+
+sal_Bool Desktop::impl_terminate()
+{
TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS );
SYNCHRONIZED_START