Core/Database: Close the MySQL connection only after getting the last error code

This commit is contained in:
Giacomo Pozzoni authored and Ovahlord committed 2020-04-15 11:06:18 +02:00
1 parent 8819428919
commit dd6498b8f9
1 file changed
+2 -1
@@ -153,8 +153,9 @@ uint32 MySQLConnection::Open()
else
{
TC_LOG_ERROR("sql.sql", "Could not connect to MySQL database at %s: %s", m_connectionInfo.host.c_str(), mysql_error(mysqlInit));
uint32 errorCode = mysql_errno(mysqlInit);
mysql_close(mysqlInit);
return mysql_errno(mysqlInit);
return errorCode;
}
}