diff options
author | Hans Hagen <pragma@wxs.nl> | 2019-04-04 14:11:01 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-04-04 14:11:01 +0200 |
commit | 64f6e8fc0c6cb9254a6fe3db0b4ab31c51cf8524 (patch) | |
tree | 1b36a0b35f5b6d516d27fe817a27249d4c6d9c78 /tex/context/base/mkiv/driv-ini.lua | |
parent | 70a938c4934f042face9805fc4c392c0676b11d5 (diff) | |
download | context-64f6e8fc0c6cb9254a6fe3db0b4ab31c51cf8524.tar.gz |
2019-04-04 13:38:00
Diffstat (limited to 'tex/context/base/mkiv/driv-ini.lua')
-rw-r--r-- | tex/context/base/mkiv/driv-ini.lua | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tex/context/base/mkiv/driv-ini.lua b/tex/context/base/mkiv/driv-ini.lua index e16327f27..f3d62c778 100644 --- a/tex/context/base/mkiv/driv-ini.lua +++ b/tex/context/base/mkiv/driv-ini.lua @@ -21,11 +21,13 @@ local instances = { } local helpers = { } local prepared = { } local wrappedup = { } +local cleanedup = { } local currentdriver = "default" local prepare = nil local convert = nil local wrapup = nil +local cleanup = nil local outputfilename = nil drivers = drivers or { @@ -42,6 +44,7 @@ local defaulthandlers = { finalize = dummy, updatefontstate = dummy, wrapup = dummy, + cleanup = dummy, convert = dummy, outputfilename = dummy, } @@ -78,13 +81,23 @@ function drivers.outputfilename() return outputfilename() end - luatex.wrapup(function() - if not wrappedup[currentdriver] then + if wrapup and not wrappedup[currentdriver] then starttiming(drivers) wrapup() stoptiming(drivers) wrappedup[currentdriver] = true + cleanedup[currentdriver] = true + end +end) + +luatex.cleanup(function() + if cleanup and not cleanedup[currentdriver] then + starttiming(drivers) + cleanup() + stoptiming(drivers) + wrappedup[currentdriver] = true + cleanedup[currentdriver] = true end end) @@ -93,6 +106,7 @@ function drivers.enable(name) local actions = instances[currentdriver].actions prepare = actions.prepare wrapup = actions.wrapup + cleanup = actions.cleanup convert = actions.convert outputfilename = actions.outputfilename -- |