summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-07-12 18:54:33 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-07-12 18:56:49 +0200
commit5a0017f890b84fdc90db2bb95cb157fdf9eb9923 (patch)
tree41f0339f00222190d836c7b599650fa4dfac7871 /sfx2
parent5d5667062c228f83db0c2a7c5967619f012c809b (diff)
avoid crash in unit test due to global objects
The lifecycle of the XFrame and the XController are both correct but getCurrentController has already been reset when the SidebarController::dispose is called. This avoids then calling the XController destructor during exit when taking a SolarMutex is a problem. Change-Id: I54470f091e506fb397e2424d2d3c4ac051cae924
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/sidebar/SidebarController.cxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/sfx2/source/sidebar/SidebarController.cxx b/sfx2/source/sidebar/SidebarController.cxx
index c67447f0770a..403a40b443e3 100644
--- a/sfx2/source/sidebar/SidebarController.cxx
+++ b/sfx2/source/sidebar/SidebarController.cxx
@@ -221,16 +221,11 @@ void SAL_CALL SidebarController::disposing()
aDeck.disposeAndClear();
}
- SidebarControllerContainer::iterator iEntry (maSidebarControllerContainer.find(mxFrame->getController()));
- if (iEntry != maSidebarControllerContainer.end())
- maSidebarControllerContainer.erase(iEntry);
+ uno::Reference<css::frame::XController> xController = mxFrame->getController();
+ if (!xController.is())
+ xController = mxCurrentController;
- css::uno::Reference<css::ui::XContextChangeEventMultiplexer> xMultiplexer (
- css::ui::ContextChangeEventMultiplexer::get(
- ::comphelper::getProcessComponentContext()));
- if (xMultiplexer.is())
- xMultiplexer->removeAllContextChangeEventListeners(
- static_cast<css::ui::XContextChangeEventListener*>(this));
+ unregisterSidebarForFrame(this, xController);
if (mxReadOnlyModeDispatch.is())
mxReadOnlyModeDispatch->removeStatusListener(this, Tools::GetURL(gsReadOnlyCommandName));