Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Delete timer on removal.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 26 Sep 2017 13:16:53 +0000 (15:16 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 26 Sep 2017 15:30:43 +0000 (17:30 +0200)
src/simix/ActorImpl.cpp
src/simix/smx_global.cpp

index 124aae8..a55a783 100644 (file)
@@ -73,8 +73,10 @@ void SIMIX_process_cleanup(smx_actor_t process)
   SIMIX_process_on_exit_runall(process);
 
   /* Unregister from the kill timer if any */
   SIMIX_process_on_exit_runall(process);
 
   /* Unregister from the kill timer if any */
-  if (process->kill_timer != nullptr)
+  if (process->kill_timer != nullptr) {
     SIMIX_timer_remove(process->kill_timer);
     SIMIX_timer_remove(process->kill_timer);
+    process->kill_timer = nullptr;
+  }
 
   xbt_os_mutex_acquire(simix_global->mutex);
 
 
   xbt_os_mutex_acquire(simix_global->mutex);
 
index dd8daa8..90deaa8 100644 (file)
@@ -575,7 +575,7 @@ smx_timer_t SIMIX_timer_set(double date, simgrid::xbt::Task<void()> callback)
 
 /** @brief cancels a timer that was added earlier */
 void SIMIX_timer_remove(smx_timer_t timer) {
 
 /** @brief cancels a timer that was added earlier */
 void SIMIX_timer_remove(smx_timer_t timer) {
-  xbt_heap_rm_elm(simix_timers, timer, timer->getDate());
+  delete static_cast<smx_timer_t>(xbt_heap_rm_elm(simix_timers, timer, timer->getDate()));
 }
 
 /** @brief Returns the date at which the timer will trigger (or 0 if nullptr timer) */
 }
 
 /** @brief Returns the date at which the timer will trigger (or 0 if nullptr timer) */