diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-05-05 13:38:55 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-05-20 15:23:38 +0100 |
commit | 7d485679a317a586c2e0eb20607b2e1158dddaeb (patch) | |
tree | cedbbd5aafd9d5584f18c7ca9b072624093642d8 /padmin | |
parent | 853ced9be97d68eac54982f9327c0d70737236c2 (diff) |
config leaks etc., dispose default component
Diffstat (limited to 'padmin')
-rw-r--r-- | padmin/source/pamain.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/padmin/source/pamain.cxx b/padmin/source/pamain.cxx index 7e47e4264d8c..3486f741d471 100644 --- a/padmin/source/pamain.cxx +++ b/padmin/source/pamain.cxx @@ -51,6 +51,7 @@ using namespace padmin; using namespace cppu; using namespace com::sun::star::uno; using namespace com::sun::star::lang; +using namespace com::sun::star::frame; using namespace comphelper; using ::rtl::OUString; @@ -104,10 +105,11 @@ int MyApp::Main() //------------------------------------------------- // create the global service-manager //------------------------------------------------- + Reference< XComponentContext > xCtx; Reference< XMultiServiceFactory > xFactory; try { - Reference< XComponentContext > xCtx = defaultBootstrap_InitialComponentContext(); + xCtx = defaultBootstrap_InitialComponentContext(); xFactory = Reference< XMultiServiceFactory >( xCtx->getServiceManager(), UNO_QUERY ); if( xFactory.is() ) setProcessServiceFactory( xFactory ); @@ -175,6 +177,18 @@ int MyApp::Main() */ ::ucbhelper::ContentBroker::deinitialize(); + /* + * clean up UNO + */ + try + { + Reference<XComponent> xComp(xCtx, UNO_QUERY_THROW); + xComp->dispose(); + } + catch(...) + { + } + return EXIT_SUCCESS; } |