Skip to content

Commit 3b0745a

Browse files
authored
Fix the error when calling removeAndResetChannel twice (an-tao#174)
1 parent 81983fa commit 3b0745a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

trantor/net/inner/Connector.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ void Connector::connecting(int sockfd)
139139

140140
int Connector::removeAndResetChannel()
141141
{
142+
if (!channelPtr_)
143+
{
144+
return -1;
145+
}
142146
channelPtr_->disableAll();
143147
channelPtr_->remove();
144148
int sockfd = channelPtr_->fd();

0 commit comments

Comments
 (0)