fix bug: coredump if set linger and immediate together

In function session_base_t::reconnect, if we set immediate to 1 and set linger, we will get into first block of reconnect function, and set pipe to NULL, but we forget to cancel timer of linger. Once timer tiggered, we will get coredump. Solution: cancel timer in the end of set pipe to NULL
This commit is contained in:
laplaceyang 2017-06-02 11:36:41 +08:00
parent bcc30f2ab0
commit 67a6594fc0

View File

@ -506,6 +506,11 @@ void zmq::session_base_t::reconnect ()
pipe->terminate (false);
terminating_pipes.insert (pipe);
pipe = NULL;
if (has_linger_timer) {
cancel_timer (linger_timer_id);
has_linger_timer = false;
}
}
reset ();