fixed possible crash when connection was destructed while it was still busy resolving the domain name
This commit is contained in:
parent
1370afee94
commit
41b07672e0
|
|
@ -152,6 +152,9 @@ public:
|
||||||
{
|
{
|
||||||
// stop monitoring the pipe filedescriptor
|
// stop monitoring the pipe filedescriptor
|
||||||
_handler->monitor(_connection, _pipe.in(), 0);
|
_handler->monitor(_connection, _pipe.in(), 0);
|
||||||
|
|
||||||
|
// wait for the thread to be ready
|
||||||
|
_thread.join();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -165,9 +168,6 @@ public:
|
||||||
// only works if the incoming pipe is readable
|
// only works if the incoming pipe is readable
|
||||||
if (fd != _pipe.in() || !(flags & readable)) return this;
|
if (fd != _pipe.in() || !(flags & readable)) return this;
|
||||||
|
|
||||||
// wait for the thread to be ready
|
|
||||||
_thread.join();
|
|
||||||
|
|
||||||
// do we have a valid socket?
|
// do we have a valid socket?
|
||||||
if (_socket >= 0) return new TcpConnected(_connection, _socket, std::move(_buffer), _handler);
|
if (_socket >= 0) return new TcpConnected(_connection, _socket, std::move(_buffer), _handler);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue