mirror of
https://github.com/mirage/qubes-mirage-firewall.git
synced 2024-12-29 09:06:18 -05:00
15 lines
287 B
OCaml
15 lines
287 B
OCaml
|
(* Copyright (C) 2015, Thomas Leonard <thomas.leonard@unikernel.com>
|
||
|
See the README file for details. *)
|
||
|
|
||
|
type t = (unit -> unit) list ref
|
||
|
|
||
|
let create () = ref []
|
||
|
|
||
|
let on_cleanup t fn =
|
||
|
t := fn :: !t
|
||
|
|
||
|
let cleanup t =
|
||
|
let tasks = !t in
|
||
|
t := [];
|
||
|
List.iter (fun f -> f ()) tasks
|