Kaydet (Commit) 34fd6bf1 authored tarafından Stephan Bergmann's avatar Stephan Bergmann Kaydeden (comit) Miklos Vajna

Cleanly remove components from rdb again that fail during live insertion

Such failure happens e.g. for components that bring along duplicate UNO
implementation names, and if they ever got added to an rdb, LO would afterwards
refuse to start forever.

Change-Id: Ia62ac496547a45f5a72fdc81543f15a417c09687
(cherry picked from commit 2a31dd40)
Reviewed-on: https://gerrit.libreoffice.org/1999Reviewed-by: 's avatarMiklos Vajna <vmiklos@suse.cz>
Tested-by: 's avatarMiklos Vajna <vmiklos@suse.cz>
üst 795796da
......@@ -1459,14 +1459,15 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
css::uno::UNO_QUERY_THROW);
}
}
css::uno::Reference< css::registry::XImplementationRegistration>(
css::uno::Reference< css::registry::XImplementationRegistration> impreg(
context->getServiceManager()->createInstanceWithContext(
rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star.registry.ImplementationRegistration")),
context),
css::uno::UNO_QUERY_THROW)->registerImplementation(
m_loader, url, getRDB());
css::uno::UNO_QUERY_THROW);
css::uno::Reference< css::registry::XSimpleRegistry > rdb(getRDB());
impreg->registerImplementation(m_loader, url, rdb);
// Only write to unorc after successful registration; it may fail if
// there is no suitable java
if (m_loader == "com.sun.star.loader.Java2" && !jarManifestHeaderPresent(url, OUSTR("UNO-Type-Path"), xCmdEnv))
......@@ -1477,7 +1478,20 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
std::vector< css::uno::Reference< css::uno::XInterface > > factories;
getComponentInfo(&data, startup ? 0 : &factories, context);
if (!startup) {
componentLiveInsertion(data, factories);
try {
componentLiveInsertion(data, factories);
} catch (css::uno::Exception & e) {
SAL_INFO(
"desktop.deployment", "caught Exception " << e.Message);
try {
impreg->revokeImplementation(url, rdb);
} catch (css::uno::RuntimeException & e2) {
SAL_WARN(
"desktop.deployment",
"ignored RuntimeException " << e2.Message);
}
throw;
}
}
m_registered = REG_REGISTERED;
that->addDataToDb(url, data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment