From 52ff78ffa3d4c3b04195a36faf10f3f84f0e1dfa Mon Sep 17 00:00:00 2001 From: Derek Bankieris Date: Thu, 31 Mar 2016 12:36:05 -0500 Subject: [PATCH] refs #209 Completely remove event in EventManager::remove_event --- trick_source/sim_services/EventManager/EventManager.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/trick_source/sim_services/EventManager/EventManager.cpp b/trick_source/sim_services/EventManager/EventManager.cpp index 082b0cf9..53c5c6fe 100644 --- a/trick_source/sim_services/EventManager/EventManager.cpp +++ b/trick_source/sim_services/EventManager/EventManager.cpp @@ -209,6 +209,14 @@ int Trick::EventManager::remove_event(Trick::Event * in_event) { } } + if (num_active_events == 0) { + TMM_delete_var_a(active_events); + active_events = NULL; + } + else { + active_events = (Trick::Event **)TMM_resize_array_1d_a(active_events, num_active_events); + } + if ( in_event->get_free_on_removal() ) { TMM_delete_var_a(in_event) ; }