Kaydet (Commit) 18c27429 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in mysqlc

Change-Id: Ife3a044beae03c7623c1bd3c2ef6ce5595f97cca
Reviewed-on: https://gerrit.libreoffice.org/53223Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst cd0a8777
...@@ -67,8 +67,7 @@ OCommonStatement::~OCommonStatement() ...@@ -67,8 +67,7 @@ OCommonStatement::~OCommonStatement()
void OCommonStatement::disposeResultSet() void OCommonStatement::disposeResultSet()
{ {
// free the cursor if alive // free the cursor if alive
delete cppStatement; cppStatement.reset();
cppStatement = nullptr;
} }
void OCommonStatement::disposing() void OCommonStatement::disposing()
...@@ -78,7 +77,7 @@ void OCommonStatement::disposing() ...@@ -78,7 +77,7 @@ void OCommonStatement::disposing()
disposeResultSet(); disposeResultSet();
m_xConnection.clear(); m_xConnection.clear();
delete cppStatement; cppStatement.reset();
OCommonStatement_IBase::disposing(); OCommonStatement_IBase::disposing();
} }
......
...@@ -66,7 +66,7 @@ namespace connectivity ...@@ -66,7 +66,7 @@ namespace connectivity
protected: protected:
rtl::Reference<OConnection> m_xConnection; // The owning Connection object rtl::Reference<OConnection> m_xConnection; // The owning Connection object
sql::Statement *cppStatement; std::unique_ptr<sql::Statement> cppStatement;
protected: protected:
void disposeResultSet(); void disposeResultSet();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment