summaryrefslogtreecommitdiff
path: root/desktop/source/pkgchk/unopkg/unopkg_app.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source/pkgchk/unopkg/unopkg_app.cxx')
-rw-r--r--desktop/source/pkgchk/unopkg/unopkg_app.cxx42
1 files changed, 4 insertions, 38 deletions
diff --git a/desktop/source/pkgchk/unopkg/unopkg_app.cxx b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
index ef16ea1b6a41..938591a2c831 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_app.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_app.cxx
@@ -48,7 +48,6 @@
#include "com/sun/star/deployment/ui/PackageManagerDialog.hpp"
#include "com/sun/star/ui/dialogs/XExecutableDialog.hpp"
-#include "com/sun/star/lang/DisposedException.hpp"
#include "boost/scoped_array.hpp"
#include "com/sun/star/ui/dialogs/XDialogClosedListener.hpp"
#include "com/sun/star/bridge/XBridgeFactory.hpp"
@@ -189,42 +188,9 @@ Reference<deployment::XPackage> findPackage(
} // anon namespace
-
-//workaround for some reason the bridge threads which communicate with the uno.exe
-//process are not releases on time
-void disposeBridges(Reference<css::uno::XComponentContext> ctx)
-{
- if (!ctx.is())
- return;
-
- Reference<css::bridge::XBridgeFactory> bridgeFac(
- ctx->getServiceManager()->createInstanceWithContext(
- OUSTR("com.sun.star.bridge.BridgeFactory"), ctx),
- UNO_QUERY);
-
- if (bridgeFac.is())
- {
- const Sequence< Reference<css::bridge::XBridge> >seqBridges = bridgeFac->getExistingBridges();
- for (sal_Int32 i = 0; i < seqBridges.getLength(); i++)
- {
- Reference<css::lang::XComponent> comp(seqBridges[i], UNO_QUERY);
- if (comp.is())
- {
- try {
- comp->dispose();
- }
- catch ( const css::lang::DisposedException& )
- {
- }
- }
- }
- }
-}
-
extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
{
tools::extendApplicationEnvironment();
- DisposeGuard disposeGuard;
bool bNoOtherErrorMsg = false;
OUString subCommand;
bool option_shared = false;
@@ -376,8 +342,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
}
xComponentContext = getUNO(
- disposeGuard, option_verbose, option_shared, subcmd_gui,
- xLocalComponentContext );
+ option_verbose, option_shared, subcmd_gui, xLocalComponentContext );
Reference<deployment::XExtensionManager> xExtensionManager(
deployment::ExtensionManager::get( xComponentContext ) );
@@ -580,6 +545,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
xDialog->startExecuteModal(xListener);
dialogEnded.wait();
+ return 0;
}
else
{
@@ -596,7 +562,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
if (option_verbose)
dp_misc::writeConsole(OUSTR("\n" APP_NAME " done.\n"));
//Force to release all bridges which connect us to the child processes
- disposeBridges(xLocalComponentContext);
+ dp_misc::disposeBridges(xLocalComponentContext);
return 0;
}
catch (const ucb::CommandFailedException &e)
@@ -645,7 +611,7 @@ extern "C" DESKTOP_DLLPUBLIC int unopkg_main()
}
if (!bNoOtherErrorMsg)
dp_misc::writeConsoleError("\n" APP_NAME " failed.\n");
- disposeBridges(xLocalComponentContext);
+ dp_misc::disposeBridges(xLocalComponentContext);
return 1;
}