From 7ad22252171f1e8c0ad65f0b9f8e38024f1e1bde Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 11 Oct 2022 20:57:35 +0200 Subject: try to make CppunitTest_embeddedobj_msole more reliable It sometimes crashes on windows. Switch to using the same tearDown() logic as UnoApiTest::closeDocument, which seems to be the most reliable variant of this kind of code. Change-Id: I1493d6d265763b2aec4ee94f4ee66378dbe280b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141238 Tested-by: Jenkins Reviewed-by: Noel Grandin --- embeddedobj/qa/cppunit/msole.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'embeddedobj') diff --git a/embeddedobj/qa/cppunit/msole.cxx b/embeddedobj/qa/cppunit/msole.cxx index c7ec2476f8a1..778186f01b55 100644 --- a/embeddedobj/qa/cppunit/msole.cxx +++ b/embeddedobj/qa/cppunit/msole.cxx @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -55,8 +56,12 @@ void Test::setUp() void Test::tearDown() { - if (mxComponent.is()) - mxComponent->dispose(); + if (mxComponent) + { + uno::Reference xCloseable(mxComponent, css::uno::UNO_QUERY_THROW); + xCloseable->close(false); + mxComponent.clear(); + } test::BootstrapFixture::tearDown(); } -- cgit