diff options
author | Caolán McNamara <caolanm@redhat.com> | 2010-10-11 14:51:39 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2010-10-12 15:34:49 +0100 |
commit | c8cb473403cdc034f99bdbd5cd62082d342963db (patch) | |
tree | 08de308a1152b4d4f274b0c22513857154825596 /desktop/source/pkgchk/unopkg | |
parent | 9e75e8684b5562ba014693993eb79ece0cc22a9c (diff) |
#i112760# deinitialize ucb when shutting down unopkg
Diffstat (limited to 'desktop/source/pkgchk/unopkg')
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_misc.cxx | 1 | ||||
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_shared.h | 18 |
2 files changed, 13 insertions, 6 deletions
diff --git a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx index d7b6e1ca2336..d1471866206c 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_misc.cxx +++ b/desktop/source/pkgchk/unopkg/unopkg_misc.cxx @@ -396,6 +396,7 @@ Reference<XComponentContext> bootstrapStandAlone( if (! ::ucbhelper::ContentBroker::initialize( xServiceManager, ucb_args )) throw RuntimeException( OUSTR("cannot initialize UCB!"), 0 ); + disposeGuard.setDeinitUCB(); return xContext; } diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h index 4975cc4c087b..55c86260ca8f 100644 --- a/desktop/source/pkgchk/unopkg/unopkg_shared.h +++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h @@ -34,6 +34,7 @@ #include "tools/resmgr.hxx" #include "rtl/ustring.hxx" #include "unotools/configmgr.hxx" +#include "ucbhelper/contentbroker.hxx" #define APP_NAME "unopkg" @@ -137,15 +138,14 @@ bool isBootstrapVariable(sal_uInt32 * pIndex); class DisposeGuard { css::uno::Reference<css::lang::XComponent> m_xComp; - + bool m_bDeinitUCB; public: - inline DisposeGuard() {} - inline DisposeGuard( - css::uno::Reference<css::lang::XComponent> const & xComp ) - : m_xComp( xComp ) {} - + DisposeGuard(): m_bDeinitUCB(false) {} inline ~DisposeGuard() { + if (m_bDeinitUCB) + ::ucbhelper::ContentBroker::deinitialize(); + if (m_xComp.is()) m_xComp->dispose(); } @@ -155,6 +155,12 @@ public: { m_xComp = xComp; } + + inline void setDeinitUCB() + { + m_bDeinitUCB = true; + } + }; //============================================================================== |