Kaydet (Commit) 2f3358d7 authored tarafından Joachim Lingner's avatar Joachim Lingner

jl161 #i114933# solve deadlock problem when adding an extension

üst 8c1f6c9b
......@@ -531,7 +531,11 @@ ExtensionManager::getSupportedPackageTypes()
{
return m_userRepository->getSupportedPackageTypes();
}
//Do some necessary checks and user interaction. This function does not
//aquire the extension manager mutex and that mutex must not be aquired
//when this function is called. doChecksForAddExtension does synchronous
//user interactions which may require aquiring the solar mutex.
//Returns true if the extension can be installed.
bool ExtensionManager::doChecksForAddExtension(
Reference<deploy::XPackageManager> const & xPackageMgr,
uno::Sequence<beans::NamedValue> const & properties,
......@@ -708,6 +712,9 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
xOldExtension, Reference<task::XAbortChannel>(),
Reference<ucb::XCommandEnvironment>());
tmpExtensionRemoveGuard.reset(xExtensionBackup);
//xTmpExtension will later be used to check the dependencies
//again. However, only xExtensionBackup will be later removed
//from the tmp repository
xTmpExtension = xExtensionBackup;
OSL_ASSERT(xTmpExtension.is());
}
......@@ -783,18 +790,16 @@ Reference<deploy::XPackage> ExtensionManager::addExtension(
//Use a private AbortChannel so the user cannot interrupt.
try
{
Reference<ucb::XCommandEnvironment> tmpCmdEnv(
new TmpRepositoryCommandEnv());
if (xExtensionBackup.is())
{
Reference<deploy::XPackage> xRestored =
xPackageManager->importExtension(
xExtensionBackup, Reference<task::XAbortChannel>(),
tmpCmdEnv);
Reference<ucb::XCommandEnvironment>());
}
activateExtension(
sIdentifier, sFileName, bUserDisabled, false,
Reference<task::XAbortChannel>(), tmpCmdEnv);
Reference<task::XAbortChannel>(), Reference<ucb::XCommandEnvironment>());
}
catch (...)
{
......
......@@ -299,9 +299,6 @@ private:
getPackageManager(::rtl::OUString const & repository)
throw (css::lang::IllegalArgumentException);
//Do some necessary checks and user interaction. This function does not
//aquire the extension manager mutex.
//Returns true if the extension can be installed.
bool doChecksForAddExtension(
css::uno::Reference<css::deployment::XPackageManager> const & xPackageMgr,
css::uno::Sequence<css::beans::NamedValue> const & properties,
......
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