summaryrefslogtreecommitdiff
path: root/configmgr/source/rootaccess.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@suse.com>2011-08-31 00:37:22 -0400
committerKohei Yoshida <kohei.yoshida@suse.com>2011-08-31 00:51:19 -0400
commit4580e570bd8ae86b509c7d566e4ff4b144fa8ed4 (patch)
tree75cde3bdddfb4d64c743eb915394224449753f12 /configmgr/source/rootaccess.cxx
parentb19dcd453aad3a43331141adc7e859a840bbfc4c (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/rootaccess.cxx')
-rw-r--r--configmgr/source/rootaccess.cxx21
1 files changed, 11 insertions, 10 deletions
diff --git a/configmgr/source/rootaccess.cxx b/configmgr/source/rootaccess.cxx
index 4ae38c43797a..47f2c2a97992 100644
--- a/configmgr/source/rootaccess.cxx
+++ b/configmgr/source/rootaccess.cxx
@@ -77,7 +77,7 @@ RootAccess::RootAccess(
Components & components, rtl::OUString const & pathRepresentation,
rtl::OUString const & locale, bool update):
Access(components), pathRepresentation_(pathRepresentation),
- locale_(locale), update_(update)
+ locale_(locale), update_(update), finalized_(false), alive_(true)
{
lock_ = lock();
}
@@ -130,10 +130,15 @@ bool RootAccess::isUpdate() const {
return update_;
}
+void RootAccess::setAlive(bool b) {
+ alive_ = b;
+}
+
RootAccess::~RootAccess()
{
osl::MutexGuard g(*lock_);
- getComponents().removeRootAccess(this);
+ if (alive_)
+ getComponents().removeRootAccess(this);
}
Path RootAccess::getRelativePath() {
@@ -291,24 +296,20 @@ void RootAccess::removeChangesListener(
}
}
-extern int tempHACK;
-
void RootAccess::commitChanges()
throw (css::lang::WrappedTargetException, css::uno::RuntimeException)
{
#if OSL_DEBUG_LEVEL > 0
OSL_ASSERT(thisIs(IS_UPDATE));
#endif
+ if (!alive_)
+ {
+ return;
+ }
Broadcaster bc;
{
osl::MutexGuard g(*lock_);
- // OSL_ENSURE(tempHACK, "fucktastic!, seriously busted lifecycles\n");
- if (!tempHACK)
- {
- return;
- }
-
checkLocalizedPropertyAccess();
int finalizedLayer;
Modifications globalMods;