summaryrefslogtreecommitdiffstats
path: root/src/sql/drivers/mysql/qsql_mysql.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql/drivers/mysql/qsql_mysql.cpp')
-rw-r--r--src/sql/drivers/mysql/qsql_mysql.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sql/drivers/mysql/qsql_mysql.cpp b/src/sql/drivers/mysql/qsql_mysql.cpp
index fbefa0c..51fc306 100644
--- a/src/sql/drivers/mysql/qsql_mysql.cpp
+++ b/src/sql/drivers/mysql/qsql_mysql.cpp
@@ -1279,6 +1279,11 @@ bool QMYSQLDriver::open(const QString& db,
d->preparedQuerysEnabled = false;
#endif
+#ifndef QT_NO_THREAD
+ mysql_thread_init();
+#endif
+
+
setOpen(true);
setOpenError(false);
return true;
@@ -1287,6 +1292,9 @@ bool QMYSQLDriver::open(const QString& db,
void QMYSQLDriver::close()
{
if (isOpen()) {
+#ifndef QT_NO_THREAD
+ mysql_thread_end();
+#endif
mysql_close(d->mysql);
d->mysql = NULL;
setOpen(false);