Check socket is null or not before calling (add|delete)SocketForReadCheck.

pull/2/head
Tatsuhiro Tsujikawa 2011-09-11 00:12:18 +09:00
parent c408dbba72
commit b775b19366
1 changed files with 6 additions and 2 deletions

View File

@ -63,12 +63,16 @@ DHTInteractionCommand::~DHTInteractionCommand()
void DHTInteractionCommand::setReadCheckSocket(const SocketHandle& socket)
{
readCheckSocket_ = socket;
e_->addSocketForReadCheck(socket, this);
if(socket) {
e_->addSocketForReadCheck(socket, this);
}
}
void DHTInteractionCommand::disableReadCheckSocket(const SocketHandle& socket)
{
e_->deleteSocketForReadCheck(socket, this);
if(socket) {
e_->deleteSocketForReadCheck(socket, this);
}
}
bool DHTInteractionCommand::execute()