UNO methods are no longer called directly on ServiceManager

Change-Id: I037ed9899873e614e9e10c89f1f8a74efa73d737
This commit is contained in:
Stephan Bergmann 2013-01-16 13:35:29 +01:00
parent 3d6d07a7e3
commit 882aaee5ff
2 changed files with 33 additions and 33 deletions

View File

@ -656,6 +656,34 @@ void cppuhelper::ServiceManager::loadImplementation(
} }
} }
void cppuhelper::ServiceManager::disposing() {
std::vector< css::uno::Reference< css::lang::XComponent > > comps;
Data clear;
{
osl::MutexGuard g(rBHelper.rMutex);
for (Data::DynamicImplementations::const_iterator i(
data_.dynamicImplementations.begin());
i != data_.dynamicImplementations.end(); ++i)
{
assert(i->second.get() != 0);
if (i->second->component.is()) {
comps.push_back(i->second->component);
}
}
data_.namedImplementations.swap(clear.namedImplementations);
data_.dynamicImplementations.swap(clear.dynamicImplementations);
data_.services.swap(clear.services);
data_.singletons.swap(clear.singletons);
}
for (std::vector<
css::uno::Reference< css::lang::XComponent > >::const_iterator i(
comps.begin());
i != comps.end(); ++i)
{
removeEventListenerFromComponent(*i);
}
}
rtl::OUString cppuhelper::ServiceManager::getImplementationName() rtl::OUString cppuhelper::ServiceManager::getImplementationName()
throw (css::uno::RuntimeException) throw (css::uno::RuntimeException)
{ {
@ -1102,34 +1130,6 @@ void cppuhelper::ServiceManager::disposing(
false); false);
} }
void cppuhelper::ServiceManager::disposing() {
std::vector< css::uno::Reference< css::lang::XComponent > > comps;
Data clear;
{
osl::MutexGuard g(rBHelper.rMutex);
for (Data::DynamicImplementations::const_iterator i(
data_.dynamicImplementations.begin());
i != data_.dynamicImplementations.end(); ++i)
{
assert(i->second.get() != 0);
if (i->second->component.is()) {
comps.push_back(i->second->component);
}
}
data_.namedImplementations.swap(clear.namedImplementations);
data_.dynamicImplementations.swap(clear.dynamicImplementations);
data_.services.swap(clear.services);
data_.singletons.swap(clear.singletons);
}
for (std::vector<
css::uno::Reference< css::lang::XComponent > >::const_iterator i(
comps.begin());
i != comps.end(); ++i)
{
removeEventListenerFromComponent(*i);
}
}
void cppuhelper::ServiceManager::removeEventListenerFromComponent( void cppuhelper::ServiceManager::removeEventListenerFromComponent(
css::uno::Reference< css::lang::XComponent > const & component) css::uno::Reference< css::lang::XComponent > const & component)
{ {

View File

@ -155,6 +155,11 @@ public:
css::uno::Reference< css::lang::XSingleComponentFactory > * factory1, css::uno::Reference< css::lang::XSingleComponentFactory > * factory1,
css::uno::Reference< css::lang::XSingleServiceFactory > * factory2); css::uno::Reference< css::lang::XSingleServiceFactory > * factory2);
private:
virtual ~ServiceManager() {}
virtual void SAL_CALL disposing();
virtual rtl::OUString SAL_CALL getImplementationName() virtual rtl::OUString SAL_CALL getImplementationName()
throw (css::uno::RuntimeException); throw (css::uno::RuntimeException);
@ -278,11 +283,6 @@ public:
virtual void SAL_CALL disposing(css::lang::EventObject const & Source) virtual void SAL_CALL disposing(css::lang::EventObject const & Source)
throw (css::uno::RuntimeException); throw (css::uno::RuntimeException);
private:
virtual ~ServiceManager() {}
virtual void SAL_CALL disposing();
// needs to be called with rBHelper.rMutex locked: // needs to be called with rBHelper.rMutex locked:
bool isDisposed() { return rBHelper.bDisposed || rBHelper.bInDispose; } bool isDisposed() { return rBHelper.bDisposed || rBHelper.bInDispose; }