dbaccess/source/core/api/RowSet.cxx | 4 ++-- dbaccess/source/core/api/RowSet.hxx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
New commits: commit 85ef14318897f6e32c4987ab9d76c38a9752da24 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Sep 23 08:53:17 2021 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Sep 23 13:46:33 2021 +0200 memory leak on loading dbase files see on loading qadevOOo/testdocs/BasicDB/DBTest.dbf a problem apparently since... commit a245e5c60fac58889738a9705225c6378b35eef4 Date: Tue May 8 12:42:55 2018 +0200 loplugin:useuniqueptr in ORowSet OTableContainer inherits from OCollection which has a unique and nonstandard acquire/release which forwards to a parent cppu::OWeakObject. So when it would appear to a casual observer, who assumes that it has an internal refcount, that its refcount would drop to zero and then get auto-deleted, nothing of the kind occurs. Change-Id: Ib104415ccc13c6ed9c06f975857fcd4413e2e05d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122519 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx index fb10287e9d3f..79ffe82ea2da 100644 --- a/dbaccess/source/core/api/RowSet.cxx +++ b/dbaccess/source/core/api/RowSet.cxx @@ -2227,7 +2227,7 @@ Reference< XNameAccess > ORowSet::impl_getTables_throw() DBG_UNHANDLED_EXCEPTION("dbaccess"); } - m_xTables = new OTableContainer(*this,m_aMutex,m_xActiveConnection,bCase,nullptr,nullptr,m_nInAppend); + m_xTables.reset(new OTableContainer(*this,m_aMutex,m_xActiveConnection,bCase,nullptr,nullptr,m_nInAppend)); xTables = m_xTables.get(); Sequence<OUString> aTableFilter { "%" }; m_xTables->construct(aTableFilter,Sequence< OUString>()); @@ -2250,7 +2250,7 @@ void ORowSet::impl_resetTables_nothrow() DBG_UNHANDLED_EXCEPTION("dbaccess"); } - m_xTables.clear(); + m_xTables.reset(); } void ORowSet::impl_initComposer_throw( OUString& _out_rCommandToExecute ) diff --git a/dbaccess/source/core/api/RowSet.hxx b/dbaccess/source/core/api/RowSet.hxx index a7d06a7a6567..33a1aceaa4c5 100644 --- a/dbaccess/source/core/api/RowSet.hxx +++ b/dbaccess/source/core/api/RowSet.hxx @@ -100,7 +100,7 @@ namespace dbaccess ::dbtools::WarningsContainer m_aWarnings; - rtl::Reference<OTableContainer> m_xTables; + std::unique_ptr<OTableContainer> m_xTables; OUString m_aCommand; OUString m_aDataSourceName;