From 918a56e896c3a96975301a7f1e0fda0c98de29d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Mon, 4 May 2020 13:03:41 +0200 Subject: Add shutdown-hook. --- module/main.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'module/main.scm') diff --git a/module/main.scm b/module/main.scm index 11b76d5b..82caf00d 100755 --- a/module/main.scm +++ b/module/main.scm @@ -15,6 +15,7 @@ (util time) (util app) (util config) + ((util hooks) :select (shutdown-hook)) ((entry-points html) :prefix html-) ((entry-points terminal) :prefix terminal-) @@ -97,7 +98,10 @@ (report-time! "Program start") ;; ((@ (util config) print-configuration-documentation)) (with-throw-handler #t - (lambda () (wrapped-main args)) + (lambda () (dynamic-wind (lambda () 'noop) + (lambda () (wrapped-main args)) + (lambda () (run-hook shutdown-hook)) + )) (lambda (err . args) (define stack (make-stack #t)) (format -- cgit v1.2.3