Skip to content

Commit

Permalink
remove channel_ check before delete
Browse files Browse the repository at this point in the history
  • Loading branch information
yedf committed Jun 5, 2016
1 parent 2a08c8e commit 0ac28ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion handy/conn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void TcpConn::attach(EventBase* base, int fd, Ip4Addr local, Ip4Addr peer)
state_ = State::Handshaking;
local_ = local;
peer_ = peer;
if (channel_) { delete channel_; }
delete channel_;
channel_ = new Channel(base, fd, kWriteEvent|kReadEvent);
trace("tcp constructed %s - %s fd: %d",
local_.toString().c_str(),
Expand Down

0 comments on commit 0ac28ff

Please sign in to comment.