summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2009-12-18 16:06:10 +0100
committersb <sb@openoffice.org>2009-12-18 16:06:10 +0100
commit8d1a56460f0cfc55d6cd72c1c4e936e7871c1cde (patch)
tree01cac95c12556aafb6432d8da0ce51700f3e2f82
parent875ac20478f16e5107acb222c0b851b99d2e0f27 (diff)
sb118: desktop/source/app/app.cxx: the acceptors in the AcceptorMap must be released with the solar mutex unlocked, to avoid deadlock
-rw-r--r--desktop/source/app/app.cxx4
-rw-r--r--desktop/source/app/appinit.cxx5
2 files changed, 4 insertions, 5 deletions
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index ede5fdf7511a..6b78309af7ce 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -1642,7 +1642,11 @@ void Desktop::Main()
// remove temp directory
RemoveTemporaryDirectory();
+ // The acceptors in the AcceptorMap must be released (in DeregisterServices)
+ // with the solar mutex unlocked, to avoid deadlock:
+ nAcquireCount = Application::ReleaseSolarMutex();
DeregisterServices();
+ Application::AcquireSolarMutex(nAcquireCount);
tools::DeInitTestToolLib();
diff --git a/desktop/source/app/appinit.cxx b/desktop/source/app/appinit.cxx
index e87701b4addf..b5aac5d80f7f 100644
--- a/desktop/source/app/appinit.cxx
+++ b/desktop/source/app/appinit.cxx
@@ -314,7 +314,6 @@ void Desktop::RegisterServices( Reference< XMultiServiceFactory >& xSMgr )
namespace
{
struct acceptorMap : public rtl::Static< AcceptorMap, acceptorMap > {};
- struct mtxAccMap : public rtl::Static< osl::Mutex, mtxAccMap > {};
struct CurrentTempURL : public rtl::Static< String, CurrentTempURL > {};
}
@@ -322,8 +321,6 @@ static sal_Bool bAccept = sal_False;
void Desktop::createAcceptor(const OUString& aAcceptString)
{
- // make sure nobody adds an acceptor whle we create one...
- osl::MutexGuard aGuard(mtxAccMap::get());
// check whether the requested acceptor already exists
AcceptorMap &rMap = acceptorMap::get();
AcceptorMap::const_iterator pIter = rMap.find(aAcceptString);
@@ -370,7 +367,6 @@ class enable
void Desktop::enableAcceptors()
{
RTL_LOGFILE_CONTEXT(aLog, "desktop (lo119109) Desktop::enableAcceptors");
- osl::MutexGuard aGuard(mtxAccMap::get());
if (!bAccept)
{
// from now on, all new acceptors are enabled
@@ -384,7 +380,6 @@ void Desktop::enableAcceptors()
void Desktop::destroyAcceptor(const OUString& aAcceptString)
{
- osl::MutexGuard aGuard(mtxAccMap::get());
// special case stop all acceptors
AcceptorMap &rMap = acceptorMap::get();
if (aAcceptString.compareToAscii("all") == 0) {