Fixed a crash

This commit is contained in:
WolverinDEV
2020-04-21 19:27:17 +02:00
parent 8436557418
commit 5433bc55f4
3 changed files with 9 additions and 6 deletions
@@ -89,14 +89,13 @@ void UDPSocket::finalize() {
if(event_write) event_del_noblock(event_write);
}
if(io_base)
event_base_loopexit(io_base, nullptr);
if(io_base) {
event_base_loopexit(io_base, nullptr);
}
if(is_event_thread) {
event_base_loopexit(io_base, nullptr);
this->_io_thread.detach();
} else {
event_base_loopexit(io_base, nullptr);
if(this->_io_thread.joinable())
this->_io_thread.join();
}