Fixed crash from trying to close a socket that isn't open in the first place.
This commit is contained in:
parent
aa50d3097e
commit
90d0a14b63
1 changed files with 9 additions and 7 deletions
|
|
@ -1,4 +1,4 @@
|
|||
#include "ASyncDBConnection.h"
|
||||
#include "ASyncDBConnection.h"
|
||||
#include "ScopeGuard.h"
|
||||
#include <chrono>
|
||||
|
||||
|
|
@ -87,8 +87,10 @@ void ASyncDBConnection::closeConnection()
|
|||
if (m_state == State::QuerySend) {
|
||||
m_canceller.cancel(nullptr);
|
||||
}
|
||||
if (m_state != State::NotConnected) {
|
||||
m_asioSock.close();
|
||||
m_connection.close();
|
||||
}
|
||||
doStateCallback(State::NotConnected);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue