Kaydet (Commit) 5a0017f8 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

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
üst 5d566706
......@@ -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));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment