Commit dc4cca20 authored by Dominik Charousset's avatar Dominik Charousset

fixed bug in io::broker::servant::dispose

parent 18a8a666
......@@ -188,10 +188,11 @@ class behavior_stack_based : public Base {
}
inline void handle_timeout(behavior& bhvr, std::uint32_t timeout_id) {
CPPA_REQUIRE(m_timeout_id == timeout_id);
if (timeout_id == m_timeout_id) {
m_has_timeout = false;
bhvr.handle_timeout();
}
}
protected:
......
......@@ -119,11 +119,12 @@ class broker::servant : public continuable {
}
void dispose() override {
m_broker->erase_io(read_handle());
if (m_broker->m_io.empty() && m_broker->m_accept.empty()) {
auto ptr = m_broker;
ptr->erase_io(read_handle());
if (ptr->m_io.empty() && ptr->m_accept.empty()) {
// release implicit reference count held by middleman
// in caes no reader/writer is left for this broker
m_broker->deref();
ptr->deref();
}
}
......
......@@ -180,11 +180,11 @@ int main(int argc, char** argv) {
await_all_actors_done();
CPPA_CHECKPOINT();
shutdown();
return CPPA_TEST_RESULT();
}
catch (bind_failure&) {
// try next port
++port;
}
}
return CPPA_TEST_RESULT();
}
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