Commits

Anonymous committed 37b8164

jl161 #i114933# solve deadlock problem when adding an extension

  • Participants
  • Parent commits e595462

Comments (0)

Files changed (2)

File desktop/source/deployment/manager/dp_extensionmanager.cxx

 {
     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,
                             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());
                     }
             //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 (...)
             {

File desktop/source/deployment/manager/dp_extensionmanager.hxx

     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,