Commit 95345f1b authored by Dominik Charousset's avatar Dominik Charousset

Properly handle discarded socket managers

parent cc2050ac
......@@ -120,8 +120,8 @@ void multiplexer::register_reading(const socket_manager_ptr& mgr) {
if (shutting_down_) {
// discard
} else if (mgr->mask() != operation::none) {
CAF_ASSERT(index_of(mgr) != -1);
if (mgr->mask_add(operation::read)) {
if (auto index = index_of(mgr);
index != -1 && mgr->mask_add(operation::read)) {
auto& fd = pollset_[index_of(mgr)];
fd.events |= input_mask;
}
......@@ -139,8 +139,8 @@ void multiplexer::register_writing(const socket_manager_ptr& mgr) {
if (shutting_down_) {
// discard
} else if (mgr->mask() != operation::none) {
CAF_ASSERT(index_of(mgr) != -1);
if (mgr->mask_add(operation::write)) {
if (auto index = index_of(mgr);
index != -1 && mgr->mask_add(operation::write)) {
auto& fd = pollset_[index_of(mgr)];
fd.events |= output_mask;
}
......
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