[Libreoffice-commits] core.git: sw/qa

Stephan Bergmann sbergman at redhat.com
Thu Dec 22 14:34:09 UTC 2016


 sw/qa/extras/mailmerge/mailmerge.cxx |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit 9c969c864f1ef2d4598faffbd7b98eaa0cf7d1a7
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Dec 22 15:33:33 2016 +0100

    Dispose XRowSet when done
    
    Change-Id: I143591203e7566dc822c88a081c780d9ae013c43

diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx
index 0c35652..8180383 100644
--- a/sw/qa/extras/mailmerge/mailmerge.cxx
+++ b/sw/qa/extras/mailmerge/mailmerge.cxx
@@ -60,6 +60,11 @@ public:
             else
                 mxMMComponent->dispose();
         }
+        if (mxCurResultSet.is())
+        {
+            css::uno::Reference<css::lang::XComponent>(
+                mxCurResultSet, css::uno::UNO_QUERY_THROW)->dispose();
+        }
         SwModelTestBase::tearDown();
     }
 
@@ -161,13 +166,13 @@ public:
 
         if (nDataSets > 0)
         {
-            uno::Reference< sdbc::XRowSet > xCurResultSet = getXResultFromDataset( tablename, aDBName );
-            uno::Reference< sdbcx::XRowLocate > xCurRowLocate( xCurResultSet, uno::UNO_QUERY );
-            mMMargs.push_back( beans::NamedValue( OUString( UNO_NAME_RESULT_SET ), uno::Any( xCurResultSet ) ) );
+            mxCurResultSet = getXResultFromDataset( tablename, aDBName );
+            uno::Reference< sdbcx::XRowLocate > xCurRowLocate( mxCurResultSet, uno::UNO_QUERY );
+            mMMargs.push_back( beans::NamedValue( OUString( UNO_NAME_RESULT_SET ), uno::Any( mxCurResultSet ) ) );
             std::vector< uno::Any > vResult;
             vResult.reserve( nDataSets );
             sal_Int32 i;
-            for (i = 0, xCurResultSet->first(); i < nDataSets; i++, xCurResultSet->next())
+            for (i = 0, mxCurResultSet->first(); i < nDataSets; i++, mxCurResultSet->next())
             {
                 vResult.push_back( uno::Any( xCurRowLocate->getBookmark() ) );
             }
@@ -282,6 +287,7 @@ protected:
     OUString msMailMergeOutputPrefix;
     sal_Int16 mnCurOutputType;
     uno::Reference< lang::XComponent > mxMMComponent;
+    uno::Reference< sdbc::XRowSet > mxCurResultSet;
     const char* maMMtestFilename;
 };
 


More information about the Libreoffice-commits mailing list