Re: debug hook callback is not called from __gc metamethod
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: debug hook callback is not called from __gc metamethod
- From: "Soni L." <fakedme@...>
- Date: 2017年9月19日 07:08:57 -0300
On 2017年09月19日 02:03 AM, Paul K wrote:
Hi All,
I'm running the following script and no debug hook events are
generated from the __gc metamethod (even though the lines do get
executed):
do
local a=setmetatable({},{__gc=function()
print("GC") -- 3
end})
end
debug.sethook(function(...) print(...) end,"clr")
collectgarbage("collect") -- 7
print("done") -- 8
The output using Lua 5.3:
return nil
line 7
call nil
GC
return nil
line 8
call nil
call nil
return nil
Done
return nil
return nil
return nil
"GC" is printed, but no line event is generated. I get the same result
with Lua 5.2. Is this by design?
Paul.
This has been reported before (by me). I don't remember the replies.
Seems intended, tho.
--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.