Fix: do not join the connection thread if it hasn't been started.

This commit is contained in:
Eelke Klein 2017-01-08 20:00:34 +01:00
parent 726d67bc30
commit 5e0b8578e2

View file

@ -16,7 +16,9 @@ void ASyncDBConnection::setupConnection(const std::string &connstring)
void ASyncDBConnection::closeConnection() void ASyncDBConnection::closeConnection()
{ {
m_threadData.stop(); m_threadData.stop();
m_thread.join(); if (m_thread.joinable()) {
m_thread.join();
}
} }
bool ASyncDBConnection::send(const std::string &command, on_result_callback on_result) bool ASyncDBConnection::send(const std::string &command, on_result_callback on_result)