From 4bd5d16381442fc94b6beecd6c16dd15686be924 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 30 May 2014 15:41:01 +0200 Subject: [PATCH] Fix leaks in test code Change-Id: I435fcfd6d10875565b543ea76fa8bfbf52e5f5d0 --- connectivity/qa/connectivity/mork/DriverTest.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/connectivity/qa/connectivity/mork/DriverTest.cxx b/connectivity/qa/connectivity/mork/DriverTest.cxx index ea0164989481..39d45b4fe077 100644 --- a/connectivity/qa/connectivity/mork/DriverTest.cxx +++ b/connectivity/qa/connectivity/mork/DriverTest.cxx @@ -97,6 +97,7 @@ void MorkDriverTest::tearDown() { // how to make dispose() work? // Reference< com::sun::star::lang::XComponent >( m_xMorkComponent, UNO_QUERY_THROW )->dispose(); + m_xConnection->close(); test::BootstrapFixture::tearDown(); } @@ -159,6 +160,9 @@ void MorkDriverTest::test_select_default_all() CPPUNIT_ASSERT_MESSAGE("fetch last row failed!", result); mail = xDelegatorRow->getString(1); CPPUNIT_ASSERT_MESSAGE("last row is not john@doe9.org!", mail.equalsAscii("john@doe9.org")); + + css::uno::Reference( + xStatement, css::uno::UNO_QUERY_THROW)->close(); } void MorkDriverTest::test_select_list_table_joe_doe_5() @@ -186,6 +190,9 @@ void MorkDriverTest::test_select_list_table_joe_doe_5() CPPUNIT_ASSERT_MESSAGE("fetch first row failed!", result); OUString mail = xDelegatorRow->getString(1); CPPUNIT_ASSERT_MESSAGE("last row is not john@doe5.org!", mail.equalsAscii("john@doe5.org")); + + css::uno::Reference( + xStatement, css::uno::UNO_QUERY_THROW)->close(); } CPPUNIT_TEST_SUITE_REGISTRATION(MorkDriverTest);