- /* destroy the blocking synchro if any */
- if (auto activity = waiting_synchro_) {
- activities_.remove(waiting_synchro_);
- waiting_synchro_ = nullptr;
-
+ if (waiting_synchro_ != nullptr) {
+ /* Take an extra reference on the activity object that may be unref by Comm::finish() or friends */
+ activity::ActivityImplPtr activity = waiting_synchro_;