summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-06-01 12:27:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-06-01 14:42:51 +0200
commit6ab23779456df511a4e869ee4dc48584d297effd (patch)
tree69c2245dace3e7643f5076b1f9a6dd60c77e79c1 /sw
parentd5133826621709cf201a128961f54a2c91090d03 (diff)
fix leak in CppunitTest_sw_filters_test
Change-Id: I4d6166f86d896a30b997f8cf9e9f30b34caefc4f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116530 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/core/filters-test.cxx7
-rw-r--r--sw/qa/core/filters-test2.cxx7
2 files changed, 14 insertions, 0 deletions
diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx
index c39f4e48edf5..e3dbdafdaa07 100644
--- a/sw/qa/core/filters-test.cxx
+++ b/sw/qa/core/filters-test.cxx
@@ -42,6 +42,7 @@ public:
const OUString &rUserData, SfxFilterFlags nFilterFlags,
SotClipboardFormatId nClipboardID, unsigned int nFilterVersion) override;
virtual void setUp() override;
+ virtual void tearDown() override;
// Ensure CVEs remain unbroken
void testCVEs();
@@ -208,6 +209,12 @@ void SwFiltersTest::setUp()
CPPUNIT_ASSERT_MESSAGE("no writer component!", m_xWriterComponent.is());
}
+void SwFiltersTest::tearDown()
+{
+ uno::Reference<lang::XComponent>(m_xWriterComponent, uno::UNO_QUERY_THROW)->dispose();
+ m_xWriterComponent.clear();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwFiltersTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/qa/core/filters-test2.cxx b/sw/qa/core/filters-test2.cxx
index 22fd9cfe525a..965645c3be57 100644
--- a/sw/qa/core/filters-test2.cxx
+++ b/sw/qa/core/filters-test2.cxx
@@ -38,6 +38,7 @@ public:
SfxFilterFlags nFilterFlags, SotClipboardFormatId nClipboardID,
unsigned int nFilterVersion) override;
virtual void setUp() override;
+ virtual void tearDown() override;
// Ensure CVEs remain unbroken
void testCVEs();
@@ -136,6 +137,12 @@ void SwFiltersTest2::setUp()
CPPUNIT_ASSERT_MESSAGE("no writer component!", m_xWriterComponent.is());
}
+void SwFiltersTest2::tearDown()
+{
+ uno::Reference<lang::XComponent>(m_xWriterComponent, uno::UNO_QUERY_THROW)->dispose();
+ m_xWriterComponent.clear();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SwFiltersTest2);
CPPUNIT_PLUGIN_IMPLEMENT();