diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-12-22 15:33:33 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-12-22 15:33:33 +0100 |
commit | 9c969c864f1ef2d4598faffbd7b98eaa0cf7d1a7 (patch) | |
tree | d274be585620d1b092747b1d03b8f7256dc8bfeb /sw/qa | |
parent | 1f799a9495795292af6f170925543bcee3c8dbae (diff) |
Dispose XRowSet when done
Change-Id: I143591203e7566dc822c88a081c780d9ae013c43
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/mailmerge/mailmerge.cxx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index 0c356526de26..81803830850c 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; }; |