summaryrefslogtreecommitdiff
path: root/cppuhelper/source/servicemanager.hxx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-02-07 11:10:06 +0100
committerStephan Bergmann <sbergman@redhat.com>2014-02-07 11:10:06 +0100
commit874c481801434d4fac3c50f076bff0fe3a3988b6 (patch)
treeef648de98a2359f0b27cde9091bc9f9468746365 /cppuhelper/source/servicemanager.hxx
parent138bd3d656c30911d5f45a8b6804e50857f6b30c (diff)
Simplify service manager's tracking of singletons
It only tracks whether to dispose a singleton instance now, and (at least conceptually) no longer remembers the single instance (apart from what is necessary in order to call dispose on it), as the underlying implementation already needs to keep track of that to support direct calls of constructor functions. Change-Id: I154bf05438e1db099c1c5ffb1c56377725c6bfc6
Diffstat (limited to 'cppuhelper/source/servicemanager.hxx')
-rw-r--r--cppuhelper/source/servicemanager.hxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/cppuhelper/source/servicemanager.hxx b/cppuhelper/source/servicemanager.hxx
index b6e506bfbd47..1e760ca78310 100644
--- a/cppuhelper/source/servicemanager.hxx
+++ b/cppuhelper/source/servicemanager.hxx
@@ -106,8 +106,7 @@ public:
new ImplementationInfo(
name, loader, uri, environment, constructorName, prefix,
alienContext, rdbFile)),
- constructor(0), status(STATUS_NEW),
- dispose(false)
+ constructor(0), status(STATUS_NEW), dispose(true)
{}
Implementation(
@@ -120,8 +119,7 @@ public:
theComponent):
info(new ImplementationInfo(name)), constructor(0),
factory1(theFactory1), factory2(theFactory2),
- component(theComponent), status(STATUS_LOADED),
- dispose(false)
+ component(theComponent), status(STATUS_LOADED), dispose(true)
{ assert(theFactory1.is() || theFactory2.is()); }
css::uno::Reference<css::uno::XInterface> createInstance(
@@ -146,8 +144,13 @@ public:
Status status;
osl::Mutex mutex;
- css::uno::Reference<css::uno::XInterface> singleton;
+ css::uno::Reference< css::lang::XComponent > disposeSingleton;
bool dispose;
+
+ private:
+ void updateDisposeSingleton(
+ bool singletonRequest,
+ css::uno::Reference<css::uno::XInterface> const & instance);
};
typedef std::map< rtl::OUString, boost::shared_ptr< Implementation > >