summaryrefslogtreecommitdiff
path: root/embeddedobj
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-10-11 20:57:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-10-12 10:29:17 +0200
commit7ad22252171f1e8c0ad65f0b9f8e38024f1e1bde (patch)
tree54004a0c8c25dcb0f50a589715c7e87186c531c6 /embeddedobj
parent0140fd6501c2322cffddaaa14b49137009ffcae4 (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'embeddedobj')
-rw-r--r--embeddedobj/qa/cppunit/msole.cxx9
1 files changed, 7 insertions, 2 deletions
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 <com/sun/star/embed/XStorage.hpp>
#include <com/sun/star/frame/XStorable.hpp>
#include <com/sun/star/packages/zip/ZipFileAccess.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
#include <comphelper/embeddedobjectcontainer.hxx>
#include <comphelper/propertyvalue.hxx>
@@ -55,8 +56,12 @@ void Test::setUp()
void Test::tearDown()
{
- if (mxComponent.is())
- mxComponent->dispose();
+ if (mxComponent)
+ {
+ uno::Reference<util::XCloseable> xCloseable(mxComponent, css::uno::UNO_QUERY_THROW);
+ xCloseable->close(false);
+ mxComponent.clear();
+ }
test::BootstrapFixture::tearDown();
}