From 7bd559972069055e0df726993a018f9b4d129221 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 29 May 2019 13:18:37 +0200 Subject: connectivity: fix memory leaks caused by OConnection::acquire() Followup to 58f121ef2e680697e10453add43bab9b771d153a; OConnection must not be held by rtl::Reference as that creates a cycle. (regression from 497e40ad03c27837978551ba15491c3fb2a0bf53) Change-Id: Ibd56d335e3e2631c5a57ea435f1035e89868a5a6 Reviewed-on: https://gerrit.libreoffice.org/73155 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 6bd751f9f577f25b058fb8a5479c0de7552c3ffc) Reviewed-on: https://gerrit.libreoffice.org/73243 Reviewed-by: Thorsten Behrens --- include/connectivity/sdbcx/VGroup.hxx | 3 ++- include/connectivity/sdbcx/VIndex.hxx | 3 ++- include/connectivity/sdbcx/VKey.hxx | 3 ++- include/connectivity/sdbcx/VUser.hxx | 3 ++- 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/connectivity/sdbcx/VGroup.hxx b/include/connectivity/sdbcx/VGroup.hxx index 61722d234e2f..dfff84dedb39 100644 --- a/include/connectivity/sdbcx/VGroup.hxx +++ b/include/connectivity/sdbcx/VGroup.hxx @@ -55,7 +55,8 @@ namespace connectivity public ODescriptor { protected: - rtl::Reference m_pUsers; + // no Reference! see OCollection::acquire + std::unique_ptr m_pUsers; using OGroup_BASE::rBHelper; diff --git a/include/connectivity/sdbcx/VIndex.hxx b/include/connectivity/sdbcx/VIndex.hxx index 6cd36f02861f..7ffc269cf4e7 100644 --- a/include/connectivity/sdbcx/VIndex.hxx +++ b/include/connectivity/sdbcx/VIndex.hxx @@ -57,7 +57,8 @@ namespace connectivity bool m_IsPrimaryKeyIndex; bool m_IsClustered; - rtl::Reference m_pColumns; + // no Reference! see OCollection::acquire + std::unique_ptr m_pColumns; using ODescriptor_BASE::rBHelper; virtual void refreshColumns() override; diff --git a/include/connectivity/sdbcx/VKey.hxx b/include/connectivity/sdbcx/VKey.hxx index bafab2761015..d786fb00c74a 100644 --- a/include/connectivity/sdbcx/VKey.hxx +++ b/include/connectivity/sdbcx/VKey.hxx @@ -69,7 +69,8 @@ namespace connectivity { protected: std::shared_ptr m_aProps; - rtl::Reference m_pColumns; + // no Reference! see OCollection::acquire + std::unique_ptr m_pColumns; using ODescriptor_BASE::rBHelper; // OPropertyArrayUsageHelper diff --git a/include/connectivity/sdbcx/VUser.hxx b/include/connectivity/sdbcx/VUser.hxx index 2727f167a029..c30875df873f 100644 --- a/include/connectivity/sdbcx/VUser.hxx +++ b/include/connectivity/sdbcx/VUser.hxx @@ -53,7 +53,8 @@ namespace connectivity public ODescriptor { protected: - rtl::Reference m_pGroups; + // no Reference! see OCollection::acquire + std::unique_ptr m_pGroups; using OUser_BASE::rBHelper; -- cgit v1.2.3