Fixed an abort
This commit is contained in:
parent
644391f58a
commit
4fddc87866
@ -171,8 +171,9 @@ bool VoiceClient::close_connection(const system_clock::time_point &timeout) {
|
|||||||
{
|
{
|
||||||
std::lock_guard state_lock{this->state_lock};
|
std::lock_guard state_lock{this->state_lock};
|
||||||
|
|
||||||
if(this->state == ConnectionState::DISCONNECTED) return false;
|
if(this->state == ConnectionState::DISCONNECTED) {
|
||||||
else if(this->state == ConnectionState::DISCONNECTING) {
|
return false;
|
||||||
|
} else if(this->state == ConnectionState::DISCONNECTING) {
|
||||||
/* here is nothing to pay attention for */
|
/* here is nothing to pay attention for */
|
||||||
} else if(this->state == ConnectionState::DISCONNECTING_FLUSHING) {
|
} else if(this->state == ConnectionState::DISCONNECTING_FLUSHING) {
|
||||||
if(!flush) {
|
if(!flush) {
|
||||||
@ -188,6 +189,10 @@ bool VoiceClient::close_connection(const system_clock::time_point &timeout) {
|
|||||||
|
|
||||||
debugMessage(this->getServerId(), "{} Closing voice client connection. (Flush: {})", CLIENT_STR_LOG_PREFIX, flush);
|
debugMessage(this->getServerId(), "{} Closing voice client connection. (Flush: {})", CLIENT_STR_LOG_PREFIX, flush);
|
||||||
//TODO: Move this out into a thread pool?
|
//TODO: Move this out into a thread pool?
|
||||||
|
if(this->flushing_thread->joinable()) {
|
||||||
|
logCritical(LOG_GENERAL, "VoiceClient::close_connection reached flushing thread with an active old handle. Ignoring request.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
this->flushing_thread = std::make_shared<std::thread>([this, self_lock, timeout, flush]{
|
this->flushing_thread = std::make_shared<std::thread>([this, self_lock, timeout, flush]{
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user