summaryrefslogtreecommitdiffstats
path: root/postprocess/qa
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-07-27 11:06:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-07-30 10:49:27 +0200
commit6e35794cad555485955c3b43593497dcdbf29840 (patch)
tree430c0299f21fb62faf6d0ba5e04410fafdda14d2 /postprocess/qa
parenttdf#133967: sw_uiwriter: Add unittest (diff)
downloadcore-6e35794cad555485955c3b43593497dcdbf29840.tar.gz
core-6e35794cad555485955c3b43593497dcdbf29840.zip
terminate XDesktop properly in unit tests
So that the UNO constructor work can continue - where we need the desktop to be disposed properly so that all UNO constructors objects have their dispose() called, and they can clean up their global state. We detect this case by changing a SAL_WARN to an assert in Desktop::disposing() (*) in ~ScTabViewShell, don't call EnterHandler, because that tries to create EditEngine's and other stuff, which crashes (*) Need a fake singleton so that the servicemanager calls dispose() on the AnalysAddIn and we can clear the global variable there. Change-Id: Id13b51e17afc16fcbbc65d64281cdf847e4a58cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99640 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'postprocess/qa')
-rw-r--r--postprocess/qa/services.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/postprocess/qa/services.cxx b/postprocess/qa/services.cxx
index 282197acab52..8441e92c1f00 100644
--- a/postprocess/qa/services.cxx
+++ b/postprocess/qa/services.cxx
@@ -37,6 +37,7 @@
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/reflection/XServiceConstructorDescription.hpp>
#include <com/sun/star/reflection/XServiceTypeDescription2.hpp>
+#include <com/sun/star/frame/XDesktop.hpp>
#include <comphelper/sequence.hxx>
#include <cppuhelper/exc_hlp.hxx>
#include <rtl/strbuf.hxx>
@@ -286,7 +287,9 @@ void Test::test() {
}
SolarMutexReleaser rel;
for (auto const & i: comps) {
- i->dispose();
+ // cannot call dispose() on XDesktop before calling terminate()
+ if (!css::uno::Reference<css::frame::XDesktop>(i, css::uno::UNO_QUERY))
+ i->dispose();
}
}