Skip to content

Commit

Permalink
annotate attaches itself to exit
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffleyland committed Sep 2, 2011
1 parent a7d69aa commit a250429
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lua/jit/annotate.lua
Expand Up @@ -414,9 +414,16 @@ end


local function shutdown()
annotate_off()
if not reported then annotate_report() end
end

local rawexit = os.exit
local function exit(...)
shutdown()
rawexit(...)
end


local function annotate_on()
active, reported = true, false
Expand All @@ -427,6 +434,7 @@ local function annotate_on()
if not jit_annotate_shutdown then
jit_annotate_shutdown = newproxy(true)
getmetatable(jit_annotate_shutdown).__gc = shutdown
os.exit = exit
end
end

Expand Down

0 comments on commit a250429

Please sign in to comment.