[Libreoffice-commits] core.git: connectivity/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Aug 27 09:15:25 UTC 2018
connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx | 3 +++
connectivity/source/drivers/mysqlc/mysqlc_statement.cxx | 6 +++---
2 files changed, 6 insertions(+), 3 deletions(-)
New commits:
commit 5c5515fde5f464e1b3e481404893b825270afcc3
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
AuthorDate: Thu Aug 16 17:56:12 2018 +0200
Commit: Tamás Bunth <btomi96 at gmail.com>
CommitDate: Mon Aug 27 11:15:02 2018 +0200
mysqlc: Fix issue by freeing result sets
Change-Id: I8a5f886306e028f06243768376b2a6c55df6063c
Reviewed-on: https://gerrit.libreoffice.org/59210
Tested-by: Jenkins
Reviewed-by: Tamás Bunth <btomi96 at gmail.com>
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
index 24e2b2560968..c52b587fba55 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
@@ -32,6 +32,8 @@
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
+#include <sal/log.hxx>
+
using namespace rtl;
#include <comphelper/string.hxx>
@@ -559,6 +561,7 @@ void SAL_CALL OResultSet::close()
checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
mysql_free_result(m_pResult);
+ m_pResult = nullptr;
dispose();
}
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
index 97cd50969879..cc6bf1492502 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
@@ -61,10 +61,10 @@ OCommonStatement::~OCommonStatement() {}
void OCommonStatement::disposeResultSet()
{
// free the cursor if alive
- if (m_pMysqlResult != nullptr)
+ if (m_xResultSet.is())
{
- mysql_free_result(m_pMysqlResult);
- m_pMysqlResult = nullptr;
+ m_xResultSet.clear();
+ m_pMysqlResult = nullptr; // it is freed by XResultSet
}
}
More information about the Libreoffice-commits
mailing list