Commit 67a6594f authored by laplaceyang's avatar laplaceyang

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
parent bcc30f2a
...@@ -506,6 +506,11 @@ void zmq::session_base_t::reconnect () ...@@ -506,6 +506,11 @@ void zmq::session_base_t::reconnect ()
pipe->terminate (false); pipe->terminate (false);
terminating_pipes.insert (pipe); terminating_pipes.insert (pipe);
pipe = NULL; pipe = NULL;
if (has_linger_timer) {
cancel_timer (linger_timer_id);
has_linger_timer = false;
}
} }
reset (); reset ();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment