diff options
author | Tamas Bunth <tamas.bunth@collabora.co.uk> | 2018-08-16 17:56:12 +0200 |
---|---|---|
committer | Tamás Bunth <btomi96@gmail.com> | 2018-08-27 11:15:02 +0200 |
commit | 5c5515fde5f464e1b3e481404893b825270afcc3 (patch) | |
tree | 0c4d6e31c76fb05634e18d475a5b7342336c554c | |
parent | 943125904f164d4115ed2b1681b4e4669a630853 (diff) |
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@gmail.com>
-rw-r--r-- | connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx | 3 | ||||
-rw-r--r-- | connectivity/source/drivers/mysqlc/mysqlc_statement.cxx | 6 |
2 files changed, 6 insertions, 3 deletions
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 } } |