summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-11-22 21:19:35 +0100
committerStephan Bergmann <sbergman@redhat.com>2011-11-22 21:22:24 +0100
commitf055e0e36134a54c445cdb351a5136736753714f (patch)
tree81826b8d470f0dfa331338384e7393e9ae844011 /desktop
parent264e5034688a9c3105b3d29c7083ef2565afaec6 (diff)
Upon startup, do not unnecesarily instantiate component service factories.
Discovered by Michael Meeks <michael.meeks@suse.com>.
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/deployment/registry/component/dp_component.cxx72
1 files changed, 37 insertions, 35 deletions
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index 6bf37364803f..2f15d444c5bd 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -1198,7 +1198,7 @@ void BackendImpl::extractComponentData(
componentLoader,
rtl::OUString const * componentUrl)
{
- OSL_ASSERT(context.is() && registry.is() && data != 0 && factories != 0);
+ OSL_ASSERT(context.is() && registry.is() && data != 0);
rtl::OUString registryName(registry->getKeyName());
sal_Int32 prefix = registryName.getLength();
if (!registryName.endsWithAsciiL(RTL_CONSTASCII_STRINGPARAM("/"))) {
@@ -1226,40 +1226,42 @@ void BackendImpl::extractComponentData(
singletonKeys[j]->getKeyName().copy(prefix2), name));
}
}
- css::uno::Reference< css::loader::XImplementationLoader > loader;
- if (componentLoader == 0) {
- rtl::OUString activator(
- openRegistryKey(
- keys[i],
- rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("UNO/ACTIVATOR")))->
- getAsciiValue());
- loader.set(
- smgr->createInstanceWithContext(activator, context),
- css::uno::UNO_QUERY);
- if (!loader.is()) {
- throw css::deployment::DeploymentException(
- (rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM(
- "cannot instantiate loader ")) +
- activator),
- static_cast< OWeakObject * >(this), Any());
- }
- } else {
- OSL_ASSERT(componentLoader->is());
- loader = *componentLoader;
- }
- factories->push_back(
- loader->activate(
- name, rtl::OUString(),
- (componentUrl == 0
- ? (openRegistryKey(
+ if (factories != 0) {
+ css::uno::Reference< css::loader::XImplementationLoader > loader;
+ if (componentLoader == 0) {
+ rtl::OUString activator(
+ openRegistryKey(
keys[i],
rtl::OUString(
- RTL_CONSTASCII_USTRINGPARAM("UNO/LOCATION")))->
- getAsciiValue())
- : *componentUrl),
- keys[i]));
+ RTL_CONSTASCII_USTRINGPARAM("UNO/ACTIVATOR")))->
+ getAsciiValue());
+ loader.set(
+ smgr->createInstanceWithContext(activator, context),
+ css::uno::UNO_QUERY);
+ if (!loader.is()) {
+ throw css::deployment::DeploymentException(
+ (rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "cannot instantiate loader ")) +
+ activator),
+ static_cast< OWeakObject * >(this), Any());
+ }
+ } else {
+ OSL_ASSERT(componentLoader->is());
+ loader = *componentLoader;
+ }
+ factories->push_back(
+ loader->activate(
+ name, rtl::OUString(),
+ (componentUrl == 0
+ ? (openRegistryKey(
+ keys[i],
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("UNO/LOCATION")))->
+ getAsciiValue())
+ : *componentUrl),
+ keys[i]));
+ }
}
}
@@ -1615,7 +1617,7 @@ void BackendImpl::ComponentPackageImpl::processPackage_(
data.javaTypeLibrary = true;
}
std::vector< css::uno::Reference< css::uno::XInterface > > factories;
- getComponentInfo(&data, &factories, context);
+ getComponentInfo(&data, startup ? 0 : &factories, context);
if (!startup) {
that->componentLiveInsertion(data, factories);
}
@@ -1956,7 +1958,7 @@ void BackendImpl::ComponentsPackageImpl::processPackage_(
that->openRegistryKey(
registry->getRootKey(),
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("IMPLEMENTATIONS"))),
- &data, &factories, 0, 0);
+ &data, startup ? 0 : &factories, 0, 0);
registry->close();
if (!startup) {
that->componentLiveInsertion(data, factories);