* @brief Closes the per-frame DB connection and removes the named connection. */
| 504 | * @brief Closes the per-frame DB connection and removes the named connection. |
| 505 | */ |
| 506 | void Sessions::Player::teardownLocalDb() |
| 507 | { |
| 508 | if (m_frameQuery) |
| 509 | m_frameQuery->clear(); |
| 510 | |
| 511 | m_frameQuery.reset(); |
| 512 | m_frameQueryPrepared = false; |
| 513 | |
| 514 | if (m_db && m_db->isOpen()) |
| 515 | m_db->close(); |
| 516 | |
| 517 | const QString conn = m_connectionName; |
| 518 | m_db.reset(); |
| 519 | if (!conn.isEmpty()) |
| 520 | QSqlDatabase::removeDatabase(conn); |
| 521 | |
| 522 | m_connectionName.clear(); |
| 523 | } |
| 524 | |
| 525 | /** |
| 526 | * @brief Resets all per-session caches. |