- for (cpt = xbt_dynar_length(process->on_exit) - 1; cpt >= 0; cpt--) {
- exit_fun = xbt_dynar_get_ptr(process->on_exit, cpt);
- (exit_fun->fun)(exit_fun->arg);
+ while (!xbt_dynar_is_empty(process->on_exit)) {
+ exit_fun = xbt_dynar_pop_as(process->on_exit,s_smx_process_exit_fun_t);
+ (exit_fun.fun)(exit_fun.arg);