diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-03-02 10:52:47 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-03-03 08:50:10 +0100 |
commit | d203cf7ee45b54bd505704dc798ff04b5dac1592 (patch) | |
tree | 74f46bd2f3cafc261cdf1e3c8cfb44da1fbef43d | |
parent | 097fcd045e99edcf418e8b34ccb6d6b0b8b8de4b (diff) |
loplugin:refcounting (clang-cl)
Change-Id: I400ef428921573ae345de15e94695e98f0b02a92
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111813
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | connectivity/source/drivers/ado/ADriver.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/connectivity/source/drivers/ado/ADriver.cxx b/connectivity/source/drivers/ado/ADriver.cxx index 6940c7ea6ecd..610f7722c697 100644 --- a/connectivity/source/drivers/ado/ADriver.cxx +++ b/connectivity/source/drivers/ado/ADriver.cxx @@ -27,13 +27,12 @@ #include <connectivity/dbexception.hxx> #include <cppuhelper/supportsservice.hxx> #include <o3tl/safeCoInitUninit.hxx> +#include <rtl/ref.hxx> #include <strings.hrc> #include <objbase.h> #include <resource/sharedresources.hxx> -#include <memory> - using namespace connectivity; using namespace connectivity::ado; using namespace com::sun::star::uno; @@ -94,13 +93,12 @@ Reference< XConnection > SAL_CALL ODriver::connect( const OUString& url, const S return nullptr; // we need to wrap the connection as the construct call might throw - std::unique_ptr<OConnection> pCon(new OConnection(this)); + rtl::Reference<OConnection> pCon(new OConnection(this)); pCon->construct(url,info); OConnection* pPtr = pCon.get(); - Reference< XConnection > xCon = pCon.release(); m_xConnections.push_back(WeakReferenceHelper(*pPtr)); - return xCon; + return pCon; } sal_Bool SAL_CALL ODriver::acceptsURL( const OUString& url ) |