more type-safety in odbc::ODBCDriver

Change-Id: I5db758cd282299ccd15872195a292224827d0c97
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182468
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
This commit is contained in:
Noel Grandin
2025-03-04 18:01:29 +01:00
parent 8489375bdc
commit ee66e1112d
2 changed files with 7 additions and 3 deletions
+2 -2
View File
@@ -49,7 +49,7 @@ void ODBCDriver::disposing()
for (auto const& connection : m_xConnections)
{
Reference< XComponent > xComp(connection.get(), UNO_QUERY);
rtl::Reference< OConnection > xComp(connection);
if (xComp.is())
xComp->dispose();
}
@@ -87,7 +87,7 @@ Reference< XConnection > SAL_CALL ODBCDriver::connect( const OUString& url, cons
rtl::Reference<OConnection> pCon = new OConnection(EnvironmentHandle(), this);
pCon->Construct(url,info);
m_xConnections.push_back(WeakReferenceHelper(*pCon));
m_xConnections.push_back(pCon);
return pCon;
}
+5 -1
View File
@@ -29,9 +29,12 @@
#include <osl/module.h>
#include <odbc/OFunctions.hxx>
#include <odbc/OTools.hxx>
#include <unotools/weakref.hxx>
namespace connectivity::odbc
{
class OConnection;
typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver, css::lang::XServiceInfo > ODriver_BASE;
class OOO_DLLPUBLIC_ODBCBASE SAL_NO_VTABLE ODBCDriver : public ODriver_BASE
@@ -39,7 +42,8 @@ namespace connectivity::odbc
protected:
::osl::Mutex m_aMutex;
connectivity::OWeakRefArray m_xConnections; // vector containing a list
std::vector<unotools::WeakReference<OConnection>>
m_xConnections; // vector containing a list
// of all the Connection objects
// for this Driver