summaryrefslogtreecommitdiff
path: root/connectivity/source/drivers
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-05-03 13:52:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-05-07 11:48:06 +0200
commit4d7867c3ac20083b5fd943f5bca44b102ccbe20e (patch)
treec084881e11875606a12c99cfa56ce826a231006d /connectivity/source/drivers
parent210638cc162ce36c8afab3aa64a65afbb5955939 (diff)
loplugin:useuniqueptr in OPreparedStatement
Change-Id: Iea0a8c92bbf7820b5f9e2ab79e7df662e8280b2d Reviewed-on: https://gerrit.libreoffice.org/53865 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity/source/drivers')
-rw-r--r--connectivity/source/drivers/odbc/OPreparedStatement.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/connectivity/source/drivers/odbc/OPreparedStatement.cxx b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
index 241a0d8e5f0a..9f0da27ae997 100644
--- a/connectivity/source/drivers/odbc/OPreparedStatement.cxx
+++ b/connectivity/source/drivers/odbc/OPreparedStatement.cxx
@@ -64,12 +64,15 @@ namespace
OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const OUString& sql)
:OStatement_BASE2(_pConnection)
,numParams(0)
- ,boundParams(nullptr)
,m_bPrepared(false)
{
m_sSqlStatement = sql;
}
+OPreparedStatement::~OPreparedStatement()
+{
+}
+
void SAL_CALL OPreparedStatement::acquire() throw()
{
OStatement_BASE2::acquire();
@@ -688,10 +691,7 @@ void OPreparedStatement::initBoundParam ()
if (numParams > 0)
{
- // Allocate an array of bound parameter objects
-
- boundParams = new OBoundParam[numParams];
-
+ boundParams.reset(new OBoundParam[numParams]);
}
}
@@ -853,8 +853,7 @@ void OPreparedStatement::setStream(
void OPreparedStatement::FreeParams()
{
numParams = 0;
- delete [] boundParams;
- boundParams = nullptr;
+ boundParams.reset();
}
void OPreparedStatement::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const Any& rValue)