Inside IdleConnList::findUseable the IdleConnList::removeAt call can delete
"this" IdleConnList object. The IdleConnList::clearHandlers called imediatelly
after the removeAt method, will try to use the invalid "this" object in
a comm_read_cancel function call, causing this assertion or other similar.
This patch fixes the IdleConnList::findUseable, IdleConnList::pop and
IdleConnList::findAndClose methods to call IdleConnList::clearHandlers before
the IdleConnList::removeAt is called.
This is a Measurement Factory project
// finally, a match. pop and return it.
Comm::ConnectionPointer result = theList_[i];
+ clearHandlers(result);
/* may delete this */
removeAt(i);
- clearHandlers(result);
return result;
}
// finally, a match. pop and return it.
Comm::ConnectionPointer result = theList_[i];
+ clearHandlers(result);
/* may delete this */
removeAt(i);
- clearHandlers(result);
return result;
}
if (index >= 0) {
if (parent_)
parent_->notifyManager("idle conn closure");
+ clearHandlers(conn);
/* might delete this */
removeAt(index);
- clearHandlers(conn);
conn->close();
}
}