diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2025-03-05 12:51:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2025-03-05 17:09:57 +0100 |
commit | 1b3da13029312f9e921f213bef9ef5aa51eb7946 (patch) | |
tree | c645b2bd239f8f6b02e57134562adb8d168a207f /connectivity/source | |
parent | 6e031fc7d6f039d03b537c2e4f90b6de1fde13f5 (diff) |
improve type-safety in FirebirdDriver
Change-Id: I110d7d2c10d5855b6486d84763b7e963de1617f7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182532
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source')
-rw-r--r-- | connectivity/source/drivers/firebird/Driver.cxx | 4 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Driver.hxx | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/connectivity/source/drivers/firebird/Driver.cxx b/connectivity/source/drivers/firebird/Driver.cxx index 167072ca71c8..9ed42abe6fc9 100644 --- a/connectivity/source/drivers/firebird/Driver.cxx +++ b/connectivity/source/drivers/firebird/Driver.cxx @@ -99,7 +99,7 @@ void FirebirdDriver::disposing() for (auto const& elem : m_xConnections) { - Reference< XComponent > xComp(elem.get(), UNO_QUERY); + rtl::Reference< Connection > xComp(elem.get()); if (xComp.is()) xComp->dispose(); } @@ -151,7 +151,7 @@ Reference< XConnection > SAL_CALL FirebirdDriver::connect( rtl::Reference<Connection> pCon = new Connection(); pCon->construct(url, info); - m_xConnections.emplace_back(*pCon); + m_xConnections.push_back(pCon); return pCon; } diff --git a/connectivity/source/drivers/firebird/Driver.hxx b/connectivity/source/drivers/firebird/Driver.hxx index d884b5008d6a..f126413aba94 100644 --- a/connectivity/source/drivers/firebird/Driver.hxx +++ b/connectivity/source/drivers/firebird/Driver.hxx @@ -27,6 +27,7 @@ #include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp> #include <cppuhelper/compbase.hxx> #include <unotools/tempfile.hxx> +#include <unotools/weakref.hxx> namespace connectivity::firebird { @@ -50,7 +51,8 @@ namespace connectivity::firebird protected: ::osl::Mutex m_aMutex; // mutex is need to control member access - OWeakRefArray m_xConnections; // vector containing a list + std::vector<unotools::WeakReference<Connection>> + m_xConnections; // vector containing a list // of all the Connection objects // for this Driver |