aboutsummaryrefslogtreecommitdiffstats
path: root/src/grt
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2016-03-19 17:15:26 +0100
committerTristan Gingold <tgingold@free.fr>2016-03-20 08:44:09 +0100
commit377762204612fdec51e361e5f3f3a75c67a36552 (patch)
treef8babf9b0dc79aac5c669953fe5b501b77fc7426 /src/grt
parentfd4fbfea4aa99b325fbb9fb4d1568dd5f15881df (diff)
downloadghdl-377762204612fdec51e361e5f3f3a75c67a36552.tar.gz
ghdl-377762204612fdec51e361e5f3f3a75c67a36552.tar.bz2
ghdl-377762204612fdec51e361e5f3f3a75c67a36552.zip
Always run finalizers (unless failure).
Diffstat (limited to 'src/grt')
-rw-r--r--src/grt/grt-main.adb7
-rw-r--r--src/grt/grt-processes.adb12
-rw-r--r--src/grt/grt-processes.ads3
3 files changed, 4 insertions, 18 deletions
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.