diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-08-31 00:37:22 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-08-31 00:51:19 -0400 |
commit | 4580e570bd8ae86b509c7d566e4ff4b144fa8ed4 (patch) | |
tree | 75cde3bdddfb4d64c743eb915394224449753f12 /configmgr/source/components.cxx | |
parent | b19dcd453aad3a43331141adc7e859a840bbfc4c (diff) |
Tell RootAccess when Components instance is destroyed.
This is to avoid RootAccess instances, which are ref-counted, to
avoid accessing the Components instance, which is a singleton.
The problem may arise when shutting down the entire app where it's
entirely unclear whether the RootAccess instances get destroyed first
or the Components instance does. In fact, on my Windows XP environment
this repeatedly caused crash-on-close issue which would lead to "DDE
server error" Windows system error dialog popping up afterwards.
Diffstat (limited to 'configmgr/source/components.cxx')
-rw-r--r-- | configmgr/source/components.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index d4b3130ca9ed..ec2c0a6d00bb 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -504,16 +504,12 @@ css::beans::Optional< css::uno::Any > Components::getExternalValue( return value; } -int tempHACK = 0; - Components::Components( css::uno::Reference< css::uno::XComponentContext > const & context): context_(context) { lock_ = lock(); - tempHACK = 1; - OSL_ASSERT(context.is()); RTL_LOGFILE_TRACE_AUTHOR("configmgr", "sb", "begin parsing"); parseXcsXcuLayer( @@ -592,7 +588,9 @@ Components::Components( Components::~Components() { flushModifications(); - tempHACK = 0; + for (WeakRootSet::iterator i(roots_.begin()); i != roots_.end(); ++i) { + (*i)->setAlive(false); + } } void Components::parseFileLeniently( |