Kaydet (Commit) 6a232a01 authored tarafından Tamas Bunth's avatar Tamas Bunth Kaydeden (comit) Andras Timar

mysqlc: Fix issue by freeing result sets

Change-Id: I8a5f886306e028f06243768376b2a6c55df6063c
Reviewed-on: https://gerrit.libreoffice.org/59210
Tested-by: Jenkins
Reviewed-by: 's avatarTamás Bunth <btomi96@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/59714Reviewed-by: 's avatarAndras Timar <andras.timar@collabora.com>
Tested-by: 's avatarAndras Timar <andras.timar@collabora.com>
üst 490c6cd0
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
#include <cppuhelper/supportsservice.hxx> #include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx> #include <cppuhelper/typeprovider.hxx>
#include <sal/log.hxx>
using namespace rtl; using namespace rtl;
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
...@@ -559,6 +561,7 @@ void SAL_CALL OResultSet::close() ...@@ -559,6 +561,7 @@ void SAL_CALL OResultSet::close()
checkDisposed(OResultSet_BASE::rBHelper.bDisposed); checkDisposed(OResultSet_BASE::rBHelper.bDisposed);
mysql_free_result(m_pResult); mysql_free_result(m_pResult);
m_pResult = nullptr;
dispose(); dispose();
} }
......
...@@ -61,10 +61,10 @@ OCommonStatement::~OCommonStatement() {} ...@@ -61,10 +61,10 @@ OCommonStatement::~OCommonStatement() {}
void OCommonStatement::disposeResultSet() void OCommonStatement::disposeResultSet()
{ {
// free the cursor if alive // free the cursor if alive
if (m_pMysqlResult != nullptr) if (m_xResultSet.is())
{ {
mysql_free_result(m_pMysqlResult); m_xResultSet.clear();
m_pMysqlResult = nullptr; m_pMysqlResult = nullptr; // it is freed by XResultSet
} }
} }
......
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