* @brief Closes the active database, cancels pending loads, joins the worker thread. */
| 109 | * @brief Closes the active database, cancels pending loads, joins the worker thread. |
| 110 | */ |
| 111 | void Sessions::Player::shutdown() |
| 112 | { |
| 113 | closeFile(); |
| 114 | |
| 115 | if (!m_workerThread) |
| 116 | return; |
| 117 | |
| 118 | if (m_worker) |
| 119 | m_worker->requestCancel(); |
| 120 | |
| 121 | m_workerThread->quit(); |
| 122 | m_workerThread->wait(5000); |
| 123 | |
| 124 | delete m_worker; |
| 125 | m_worker = nullptr; |
| 126 | |
| 127 | delete m_workerThread; |
| 128 | m_workerThread = nullptr; |
| 129 | } |
| 130 | |
| 131 | //-------------------------------------------------------------------------------------------------- |
| 132 | // Playback status queries |
no test coverage detected