From 377762204612fdec51e361e5f3f3a75c67a36552 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 19 Mar 2016 17:15:26 +0100 Subject: Always run finalizers (unless failure). --- src/grt/grt-main.adb | 7 ++----- src/grt/grt-processes.adb | 12 ++---------- src/grt/grt-processes.ads | 3 --- 3 files changed, 4 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/grt/grt-main.adb b/src/grt/grt-main.adb index f5006ef6b..4c37e1da7 100644 --- a/src/grt/grt-main.adb +++ b/src/grt/grt-main.adb @@ -109,8 +109,6 @@ package body Grt.Main is use Grt.Errors; Stop : Boolean; Status : Integer; - Status1 : Integer; - pragma Unreferenced (Status1); begin -- Register modules. -- They may insert hooks. @@ -174,11 +172,10 @@ package body Grt.Main is -- Do the simulation. Status := Run_Through_Longjump (Grt.Processes.Simulation'Access); - - Status1 := Run_Through_Longjump - (Grt.Processes.Finalize_Simulation'Access); end if; + Grt.Hooks.Call_Finish_Hooks; + if Flag_Stats then Disp_Stats_Hook (0); end if; diff --git a/src/grt/grt-processes.adb b/src/grt/grt-processes.adb index a105e755d..04bb2abe9 100644 --- a/src/grt/grt-processes.adb +++ b/src/grt/grt-processes.adb @@ -1119,6 +1119,8 @@ package body Grt.Processes is if Nbr_Threads /= 1 then Threads.Finish; end if; + + Call_Finalizers; end Simulation_Finish; function Simulation return Integer @@ -1133,14 +1135,4 @@ package body Grt.Processes is return Status; end Simulation; - - function Finalize_Simulation return Integer is - begin - Call_Finalizers; - - Grt.Hooks.Call_Finish_Hooks; - - return Run_Finished; - end Finalize_Simulation; - end Grt.Processes; diff --git a/src/grt/grt-processes.ads b/src/grt/grt-processes.ads index ff51b39bb..00b057e41 100644 --- a/src/grt/grt-processes.ads +++ b/src/grt/grt-processes.ads @@ -43,9 +43,6 @@ package Grt.Processes is -- < 0 in case of failure or stop request. function Simulation return Integer; - -- To be called after Simulation to run finalizer and end hooks. - function Finalize_Simulation return Integer; - -- Number of delta cycles. Nbr_Delta_Cycles : Integer; -- Number of non-delta cycles. -- cgit v1.2.3