- /* If there are requests associated with the action, then answer them */
- if (xbt_fifo_size(action->request_list))
+ /* remove the communication action from the list of pending communications
+ * of both processes (if they still exist) */
+ if (action->comm.src_proc) {
+ xbt_fifo_remove(action->comm.src_proc->comms, action);
+ }
+ if (action->comm.dst_proc) {
+ xbt_fifo_remove(action->comm.dst_proc->comms, action);
+ }
+
+ /* if there are requests associated with the action, then answer them */
+ if (xbt_fifo_size(action->request_list)) {