Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Call gap_remove in generic_update_actions_state_lazy too.
authorArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 23 Oct 2012 11:24:03 +0000 (13:24 +0200)
committerArnaud Giersch <arnaud.giersch@iut-bm.univ-fcomte.fr>
Tue, 23 Oct 2012 13:58:09 +0000 (15:58 +0200)
*** Please double-check this commit ! ***

Try to mimic what's done in generic_update_actions_state_full.
Fixes an "use after free" error with smpi_replay.

src/surf/surf_action.c

index 90d1878..e05e199 100644 (file)
@@ -434,6 +434,9 @@ void generic_update_actions_state_lazy(double now, double delta, surf_model_t mo
         model->action_state_set((surf_action_t) action,
                                              SURF_ACTION_DONE);
         surf_action_lmm_heap_remove(model->model_private->action_heap,action);
         model->action_state_set((surf_action_t) action,
                                              SURF_ACTION_DONE);
         surf_action_lmm_heap_remove(model->model_private->action_heap,action);
+
+        if (model->gap_remove && model == surf_network_model)
+          model->gap_remove(action);
       }
     }
   }
       }
     }
   }